Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Is there a way to create a sprite containing multiple other textures?  (Read 1261 times)

0 Members and 1 Guest are viewing this topic.

ThatOneGuyThatDoesStuff

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
What I want to do is create an sf::Sprite that is a compilation of a number of other given sprites/textures.

e.g. If I had 4 16x16 textures, I want to create a sprite that is 64x64 that contains those 4 smaller textures in a specific pattern. Is there any way I can do this, or something similar?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
You can't create a sprite with multiple textures directly, but you can create a single texture from them, and then map that texture to a sprite.

See sf::RenderTexture for more details.
Laurent Gomila - SFML developer

ThatOneGuyThatDoesStuff

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Ahhh, excellent. I was hoping it would be something simple. Than you kindly.

 

anything