Hello Guest

Author Topic: Can tk2dsprite support clip (glscissor) ?  (Read 6047 times)

seamas

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Can tk2dsprite support clip (glscissor) ?
« 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.
« Last Edit: July 23, 2012, 06:01:12 am by seamas »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Can tk2dsprite support clip (glscissor) ?
« Reply #1 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.

mangoocean

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Can tk2dsprite support clip (glscissor) ?
« Reply #2 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!