1
NGUI 3 Support / Suggestion for UISpriteAnimation
« on: May 24, 2016, 07:17:40 PM »
I recently needed to have a number of animated sprite objects that used the same looped animation appear side-by-side, but also needed for them to not appear to be identical. I accomplished this by adding a "SetFrame" method to your UISpriteAnimation class that simply changes the value of "mframe" to a specified index. That amounted to three lines of code that allow a UISpriteAnimation to start playing at a different frame. The addition allowed me to alter which frame the animated sprite started at, and made the multiple sprites appear to present different animations using identical frame data.
I really think this is a method that should be added to the UISpriteAnimation class going forward. Currently there is no way to specify the frame on which the animation playback commences. I understand that it's an edge-case issue, but it really is just a few lines of code that extends the functionality of the class in a significant way.
I really think this is a method that should be added to the UISpriteAnimation class going forward. Currently there is no way to specify the frame on which the animation playback commences. I understand that it's an edge-case issue, but it really is just a few lines of code that extends the functionality of the class in a significant way.

