Hello Guest

Author Topic: tk2dSprite Masking  (Read 5591 times)

DahongPunyal

  • Newbie
  • *
  • Posts: 15
    • View Profile
tk2dSprite Masking
« on: January 23, 2014, 01:43:43 am »
I am new to tk2d (also in Unity) and I want to know if it possible to create a game object for background (tk2dSprite attached), then create another game object on top of it (also attached with tk2dSprite). The second game object is for overlay and I want to add a clipping mask to it (a circle mask, so it will look like a hole). And then I will add another game object for my main sprite.

Also, I want the mask animate or change its size for a duration. Like, from small to big and vice versa. Is it possible to achieve this using tk2d or I need other library to do it?

Here's what I want to do:


Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dSprite Masking
« Reply #1 on: January 23, 2014, 11:11:01 am »
It can be done but you will have to implement it yourself using shaders. If its just the background, making a custom shader is the quickest / easiest way to do this. You won't even need an atlas for that, which makes it even easier.

DahongPunyal

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: tk2dSprite Masking
« Reply #2 on: January 23, 2014, 12:15:24 pm »
Thanks!

Can you give a link for a good tutorial of creating custom shader? I am new to Unity3D and it will be my first time to write one. :D

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dSprite Masking
« Reply #3 on: January 24, 2014, 11:06:12 am »
There are quite a few shader tutorials. I suggest reading up about them, you will open up a lot more options. Its pretty straightforward once you get the hang of it, and you'll only need a bit more than the basics for what you need.
http://unitygems.com/noobshader1/

DahongPunyal

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: tk2dSprite Masking
« Reply #4 on: January 25, 2014, 01:54:32 am »
Thanks! :D

Closed