2D Toolkit Forum

2D Toolkit => Support => Topic started by: seamas on July 23, 2012, 05:20:26 am

Title: Can tk2dsprite support clip (glscissor) ?
Post 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.
Title: Re: Can tk2dsprite support clip (glscissor) ?
Post by: unikronsoftware on July 23, 2012, 07:51:41 am
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.
Title: Re: Can tk2dsprite support clip (glscissor) ?
Post by: mangoocean on October 31, 2014, 10:24:46 pm
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!
Title: Re: Can tk2dsprite support clip (glscissor) ?
Post by: unikronsoftware on October 31, 2014, 11:18:47 pm
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