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

Author Topic: 1 Sprite = 1 Image?  (Read 2831 times)

0 Members and 1 Guest are viewing this topic.

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
1 Sprite = 1 Image?
« on: February 02, 2011, 08:55:05 am »
Do I need for every Image a different Sprite? Or is there a way how to use one Sprite for every Image or another way?
Thank advance  :roll:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
1 Sprite = 1 Image?
« Reply #1 on: February 02, 2011, 09:13:20 am »
You can do whatever you want. But it doesn't make sense to reuse the same sprite to display different images (unless it keeps the exact same transformation and rendering settings). sf::Sprite is a lightweight class which is designed to represent a 2D entity, so you should have as many sprites as entities in your scene.
Laurent Gomila - SFML developer

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
1 Sprite = 1 Image?
« Reply #2 on: February 02, 2011, 09:35:33 am »
So, the best way is have so many sprites as images?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
1 Sprite = 1 Image?
« Reply #3 on: February 02, 2011, 10:08:06 am »
It depends. What do you want to draw?
Laurent Gomila - SFML developer

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
1 Sprite = 1 Image?
« Reply #4 on: February 02, 2011, 10:27:40 am »
A lot of small picture example

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
1 Sprite = 1 Image?
« Reply #5 on: February 02, 2011, 10:47:24 am »
Then yes, you can have 1 different sprite for each picture.
Laurent Gomila - SFML developer

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
1 Sprite = 1 Image?
« Reply #6 on: February 02, 2011, 11:29:56 am »
Thank for your time  :D