2D Toolkit Forum
2D Toolkit => Support => Topic started by: seamas on July 23, 2012, 05:20:26 am
-
I want to use tk2dsprite in the following cases:
1: player's hp view. sprite's showing rect should be controlled, that is, the width of sprite may be 100, but 80 should be shown, the other 20 be clipped.
2: multiple tk2dsprites shown in a scrollview, when one scrolled, part of that sprite may out of the scrollview's bound, I don't want this part to be shown.
Some thing just like glScissor() function, how can I do that?
Thank you, I am new, I just bought 2d ToolKit from Unity Asset Store recently.
-
Hi seamas,
There are 2 samples using 2 different approaches to achieve this. They are in the private support forum, and I've linked them here for your convenience.
Clipped sprite sample - http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,115.0.html
Barbers pole sample - http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,398.0.html
One uses CPU clipping and the other does it in a CG shader.
You'll need to register your copy to get access to the private support area, these should do pretty much exactly what you need.
-
I really want to see this barber pole example, but every time I click the link it asks me to log in... again and again.
I'm a registered member so I should have access to it. Help!
-
Try these links -
http://www.2dtoolkit.com/forum/index.php/topic,115.0.html
http://www.2dtoolkit.com/forum/index.php/topic,398.0.html