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

Author Topic: Can I make an array of shapes? If yes, how?  (Read 1626 times)

0 Members and 2 Guests are viewing this topic.

wsh

  • Newbie
  • *
  • Posts: 1
    • View Profile
Can I make an array of shapes? If yes, how?
« on: March 24, 2022, 12:23:33 pm »
I am a noob in SFML and C++ in general.

I want to create an array of circles with the same shape, but I want the number of circles to be dynamic. Is this possible? Please help.

Thank you.

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Can I make an array of shapes? If yes, how?
« Reply #1 on: March 25, 2022, 01:47:23 am »
arrays can't be dynamic in size. you probably want a std::vector for that.
you can use like
std::vector<sf::CircleShape> my_circles;
Visit my game site (and hopefully help funding it? )
Website | IndieDB