Hello Guest

Author Topic: Can you have clipping on a slided sprite?  (Read 6199 times)

1337Rooster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Can you have clipping on a slided sprite?
« on: September 17, 2013, 05:29:24 am »
I would like to have clipping on a slided sprite.

Basically I want to implement a bar that fills up in my hud, as a gauge. Suppose the gauge fills vertically, and the top and bottom regions are rounded. An easy way to do this would be to

1. Display a slided sprite for the background of the gauge.
2. Display a slided sprite for the foreground of the gauge and modify its clip as the gauge grows and shrinks.

The fact that the clipping and slided sprites are separate types of sprites that don't seem like they can be used together seems like a bit of a limitation in the current API. It feels like they should be features you could apply to sprites, and it would be more powerful if you could use them both together.

gary-unikronsoftware

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 74
    • View Profile
Re: Can you have clipping on a slided sprite?
« Reply #1 on: September 17, 2013, 09:26:48 am »
Hi,

The toolkit comes with a ProgressBar prefab which sounds like what you're looking for.  You can find it in tk2dUI_demo > ControlPrefabs folder and you can choose which sprites it uses.