Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Question about Texture Packs — Gideros Forum

Question about Texture Packs

MillerszoneMillerszone Member
edited October 2011 in General questions
I was testing the "Texture Pack" example and noticed that you still have to add all the
"Bitmap.new(pack:getTextureRegion" code per image.
Is that really required? I thought that was the purpose of using tools like TexturePacker so you will have less code.

Also, I haven't tested, but will the Texture Pack "anim.txt", "anim.png" scale to "anim@2x.txt", "anim@2x.png"?

Again, I hope you don't mind me asking these questions. I just want to make sure that Gideros will do everything I need
before starting a major project. So far so good, I haven't used Corona in almost two weeks. As soon as I use Gideros
Final for a couple of weeks, I'll start spreading the word.
AnimatedSprite = gideros.class(Sprite)
function AnimatedSprite:init()
	local pack = TexturePack.new("anim.txt", "anim.png")
	self.anim = {
	self.frame = 1
	self.nframes = #self.anim
	self.subframe = 0
	self:addEventListener(Event.ENTER_FRAME, self.onEnterFrame, self)

Dislikes: vhandrea555, RMTom

+1 -1 (+0 / -2 )Share on Facebook


  • gorkemgorkem Maintainer
    We are really happy that we receive considerable constructive feedbacks from you. Merely looking at the web page, Gideros Studio might seem like a relatively new product, however we're pretty sure that it's baking well, and it'll reach to a very competitive position in a very short time.

    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 :)
  • atilimatilim Maintainer
    The main purpose of texture packing is to increase the performance (because of smaller number of texture state changes). The secondary advantage is (as you said) less code :) But our current API doesn't allow this and you need to get texture regions one by one and construct the animation yourself. The next version of Gideros Studio (2011.9) will come with a MovieClip class to make these kinds of animations easier.

    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.

  • yubaroyubaro Member
    edited January 2013
    Good morning ... I want to know if it can work with "...@2x.txt" in Texture packs?
  • yubaroyubaro Member
    edited January 2013
    Hi, @hgvyas123 thanks for your answer ... a question, I have been testing and what is recommended to be the ideal weight? ... Separate images come to weigh less than the exported file by texturepacker ... and this is more noticeable in files @2x, @4x ... thanks
  • @yubaro the difference I noticed between using texture packs for each scene or separate images is that with packs it takes longer for the scene to load, but overall performance in scene is better.
  • @ar2rsawseen thanks for your answer...your recommendation is then prefer performance on stage and not worry so much about the weight compared to the separate images?
  • @yubaro no not exactly
    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
  • yubaroyubaro Member
    edited January 2013
    :-O ok ok, I understand, @ar2rsawseen thank you very much for the recommendation and leave the doubt
  • @atilim said

    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)
    Does it still just need "anim.txt" and not "anim@2x.txt" when scaling texture packs? That is the only way that I could get it to work but it would be handy if "anim@2x.txt" could be used.


  • @petec as internally gideros still uses the old sizes (even if the image is 2x), then it can only use original anim.txt
    But is it really a problem? As in you create the highest pack and then create copies by scaling it down
  • petecpetec Member
    edited October 2013
    @ar2rsawseen Thanks for the quick reply. It's not a real problem, but I just changed one of my 2x graphics, removing it from the 2x pack. When I replaced it in the 2x pack it went at the end which was a different place from where it was originally and different to the 1x pack so I got the wrong graphics popping up until I realised what had happened! Had to rebuild the 2x pack so that the order matched the 1x pack.
Sign In or Register to comment.