Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Use texture packed sheet or Images? — Gideros Forum

Use texture packed sheet or Images?

FavflyFavfly Member
edited October 2016 in General questions
When loading a texture into a bitmap, I could use an image or a texture sheet:

--Using images:
gfx.potato = Bitmap.new(Texture.new(“images/mySpud.png”))

--Using texture sheet:
gfx.potato = Bitmap.new(self.g:getTextureRegion("mySpud.png"))


However, using images, I can load a texture without it immediately having to be a bitmap:

texture.spud = Texture.new(“images/mySpud.png”)

This is very useful to me. My question is: Can I do the same with a graphic from a texture sheet?

Cheers, in advance.

Comments

  • keszeghkeszegh Member
    edited October 2016 Accepted Answer
    well, you can certainly do e.g.
    mytextureregion=self.g:getTextureRegion("mySpud.png")
    and use this textureregion anytime you want later. isn't this good for you?

    Likes: Favfly

    +1 -1 (+1 / -0 )Share on Facebook
  • All of the images contained within a texture pack are just textures until you make them into bitmaps.
  • The main advantage is that if you can pack most of your game sprites into the single large texture sheet then the gfx system won't have to keep swapping textures - so it will be faster at displaying the images.

    Likes: Favfly

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • Thanks, everyone. This has been very useful. :-)

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.