valueerror Posted October 1, 2014 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 Link to comment Share on other sites More sharing options...
rich Posted October 1, 2014 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. Link to comment Share on other sites More sharing options...
j0hnskot Posted October 1, 2014 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 ? Link to comment Share on other sites More sharing options...
valueerror Posted October 2, 2014 Author 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 Link to comment Share on other sites More sharing options...
Recommended Posts