2D Toolkit Forum
2D Toolkit => Support => Topic started by: 1337Rooster 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.
-
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.