~~NOTOC~~ ====== SXGauge ====== ---- dataentry extension ---- author_mail : daniel@gamua.com Daniel Sperl description : A simple gauge / progress bar. lastupdate_dt : 2011-03-12 compatible : v2.0 depends : tags : gauge, bar, texture homepage_url : https://gist.github.com/867241 download_url : https://gist.github.com/gists/867241/download ---- ===== Usage ===== {{ :extensions:gauge.png?nolink|A sample gauge in its various stages.}} This Sparrow extension class displays a texture, trimmed to its left side, depending on a ratio. This can be used to create a progress bar or a rest-time display. You control the gauge by changing its ''ratio'' property to a value between 0 and 1. SXGauge *gauge = [SXGauge gaugeWithTexture:@"gauge.png"]; [self addChild:gauge]; gauge.ratio = 0.5f; In the sample on the right, the gauge is just the yellow texture. By displaying this object in front of a grey background and border, it looks as if this was a container that grows empty. ===== Changelog ===== * //2011-03-12:// First version * //2013-06-02:// Updated for Sparrow 2.0 ===== Source Code ===== %gist(867241)% ===== Discussion ===== //No comments so far. Feel free to edit this part of the page.//