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

Author Topic: Append multiple textures to a single sprite ?  (Read 1591 times)

0 Members and 1 Guest are viewing this topic.

moistweb

  • Newbie
  • *
  • Posts: 18
    • View Profile
Append multiple textures to a single sprite ?
« on: June 06, 2014, 03:22:06 am »
Hello folks,
I'm currently designing the Background class for Skywalk, and so I thought of a solution to achieve a good background management. This solution requires to append multiple loaded textures into one single sprites, but I just can't think of a solution, the only method relating textures to sprites that I know of is setTexture() ( and setTextureRect() of course). Can someone help me figure this thing out such that when I load a texture, I can add it to the end of the sprite  ( i.e. without modifying previously added textures) ?
« Last Edit: June 06, 2014, 03:24:18 am by Reda Lahdili »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Append multiple textures to a single sprite ?
« Reply #1 on: June 06, 2014, 07:54:59 am »
A sprite can't have multiple textures, but it's really easy to just use yet another sprite for it.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

moistweb

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Append multiple textures to a single sprite ?
« Reply #2 on: June 06, 2014, 11:51:36 pm »
Okay, that's what I will be using I guess, thanks for the respond ^^

 

anything