rubymotion-community / Joybox

Cocos2D & Box2D Wrapper for Ruby Motion - Currently out of date an unmaintained :-(
MIT License
280 stars 37 forks source link

SpriteFrameCache: custom order option for :where #41

Closed dabit closed 11 years ago

dabit commented 11 years ago

With this change you will be able to retrieve sprites from the Sprite Sheet in an order that is not necessarily sequential and can show a single frame several times in the animation.

Example:

frames = SpriteFrameCache.frames.where prefix: "bear", suffix: ".png", order: [1, 5, 3, 5, 3, 1]

NOTE: I am not experienced with Joybox yet, maybe there is something already in place to achieve the same thing?

NSCoder commented 11 years ago

Hey David,

Thanks for the feature!, I think something like that was missing from the sprite frame cache it seams very handy. Welcome to Joybox I hope you enjoy it and create awesome games with it :)