valueerror Posted October 1, 2014 Report Share Posted October 1, 2014 sometimes i did something like if (sprite.key == 'cat') now i am using a texture atlas and i would ocasionally need something similar like if (sprite.frameName == 'cat') actually this works somehow but not with an animation.. i'd like the initial framename used on creation of the object? the actual problem is: i am creating objects from an object layer from tiled. now i need to differentiate between different frames because the created objects get different configurations Quote Link to comment Share on other sites More sharing options...
rich Posted October 1, 2014 Report Share Posted October 1, 2014 You'll need to store it yourself as the moment you change to a new frame in an animation or atlas the old frameName is lost. Quote Link to comment Share on other sites More sharing options...
j0hnskot Posted October 1, 2014 Report Share Posted October 1, 2014 I don't think there is a property that holds the frameName used at the creation. Couldn't it be simpler to create a property that holds it by yourself? Like sprite.startingFrameName=sprite.frameName ? Quote Link to comment Share on other sites More sharing options...
valueerror Posted October 2, 2014 Author Report Share Posted October 2, 2014 ok.. thank you both... i just wanted to know if i've overlooked something.. i'm going to store it on creation then Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.