It looks like you're new here. If you want to get involved, click one of these buttons!
AnimatedSprite = gideros.class(Sprite) function AnimatedSprite:init() local pack = TexturePack.new("anim.txt", "anim.png") self.anim = { Bitmap.new(pack:getTextureRegion("anim_01.png")), Bitmap.new(pack:getTextureRegion("anim_02.png")), Bitmap.new(pack:getTextureRegion("anim_03.png")), Bitmap.new(pack:getTextureRegion("anim_04.png")), Bitmap.new(pack:getTextureRegion("anim_05.png")), Bitmap.new(pack:getTextureRegion("anim_06.png")), Bitmap.new(pack:getTextureRegion("anim_07.png")), Bitmap.new(pack:getTextureRegion("anim_08.png")), Bitmap.new(pack:getTextureRegion("anim_09.png")), Bitmap.new(pack:getTextureRegion("anim_10.png")), Bitmap.new(pack:getTextureRegion("anim_11.png")), Bitmap.new(pack:getTextureRegion("anim_12.png")), Bitmap.new(pack:getTextureRegion("anim_13.png")), } self.frame = 1 self:addChild(self.anim[1]) self.nframes = #self.anim self.subframe = 0 self:addEventListener(Event.ENTER_FRAME, self.onEnterFrame, self) end |
Dislikes: vhandrea555, RMTom
Comments
Please ask more questions and force us to make Gideros Studio a better product - we are restlessly developing at the office and actively trying to market it
Texture packs allows dynamic image resolutions but you need to use same "anim.txt" and not "anim@2x.txt". Gideros scales the coordinates in "anim.txt" to match "anim@2x.png". (But I realized that this is not enough and we also need "anim@2x.txt. I'll correct this issue with the next version)
Thank you again for your feedback. These are really important for us.
yup it will work
If you want to load scene faster with some static images (without animations, frames, changing images etc) you may as well use images separately
But if it's a game scene, and you will load lots of characters and stuff, it's much better to use packs
Thanks,
Pete
But is it really a problem? As in you create the highest pack and then create copies by scaling it down