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

Author Topic: Sprite Arrays  (Read 2207 times)

0 Members and 1 Guest are viewing this topic.

Danny Toledo

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Sprite Arrays
« on: February 17, 2011, 01:15:58 am »
Is it possible to make an array of sprites or images?
-Danny Toledo

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Sprite Arrays
« Reply #1 on: February 17, 2011, 01:19:40 am »
Yes. But generally, you should prefer dynamic STL containers like std::vector. For example, you can resize them during runtime.
Code: [Select]
std::vector<sf::Sprite> sprites;
sprites.push_back( sf::Sprite(...) );
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Danny Toledo

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Sprite Arrays
« Reply #2 on: February 17, 2011, 01:29:33 am »
Thanks, I'll look into it.
-Danny Toledo