SFML community forums

Help => Graphics => Topic started by: nelsoncookie on March 01, 2017, 03:19:17 pm

Title: Array of objects
Post by: nelsoncookie on March 01, 2017, 03:19:17 pm
Hi, i'm working on a game and want that when i create an object it gets added to an array (so it's easier to draw and maybe
change coords and stuff).
I only don't know how to do it.
If it helps here is my function:
(click to show/hide)
Thanks in advance!

Title: Re: Array of objects
Post by: Laurent on March 01, 2017, 03:22:04 pm
This is the SFML forum, for basic C++ questions there are many better places where to ask.
Title: Re: Array of objects
Post by: nelsoncookie on March 01, 2017, 03:53:42 pm
This is the SFML forum, for basic C++ questions there are many better places where to ask.
oh, sorry  :-\
Title: Re: Array of objects
Post by: Hapax on March 01, 2017, 08:33:42 pm
There are some important things you should note that are explained in the Sprites and Textures tutorial (http://www.sfml-dev.org/tutorials/2.4/graphics-sprite.php). You should also notice importance of this part (http://www.sfml-dev.org/tutorials/2.4/graphics-sprite.php#the-white-square-problem).  ;)