plicatibu Posted October 19, 2016 Share Posted October 19, 2016 Hi, guys. I know that for an image I can retrieve it's width issuing the command game.cache.getImage(key).width; But suppose that instead of a single image you have an atlas named 'atlas' and its key is 'atlas' and that it contains an image named 'logo.png'. How could I get the width of image named 'logo.png' from cache object? Link to comment Share on other sites More sharing options...
samme Posted October 19, 2016 Share Posted October 19, 2016 Try game.cache.getImage('atlas', true).frameData.getFrameByName('logo.png').width plicatibu 1 Link to comment Share on other sites More sharing options...
Tom Atom Posted October 19, 2016 Share Posted October 19, 2016 Or you can shorten it to: game.cache.getFrameByName("atlas", "Sprite").width; plicatibu 1 Link to comment Share on other sites More sharing options...
plicatibu Posted October 19, 2016 Author Share Posted October 19, 2016 @samme @Tom Atom Thank you both. Link to comment Share on other sites More sharing options...
Recommended Posts