SFML community forums
Help => General => Topic started by: declan on December 08, 2010, 03:38:26 am
-
Hey everyone!
I am trying to draw a ton of small arrows, which I then set the positions of, and rotate around the center of the arrow. Right now I'm doing it with regular lines and it's working fine, but I eventually want arrows. However, it would be a pain in the ass to rotate the two lines that make the head of the arrow around the center of the thing:
(http://imgur.com/YaVAn.png)
So my question is, is there any way to group the lines together so that I can manipulate them as a single, larger object?
Thanks!!
-
Wouldn't it work to use an image? Or make a polygon?
-
I think you can set the center of the other arrows two head lines to the middle of the other line, so they rotate around that.
-
in fact, you need some transformations to be shared with all the arrows, so you could use something like a layer (a box that contains your arrows) :
http://www.sfml-dev.org/wiki/fr/sources/layer
-
Wouldn't it work to use an image? Or make a polygon?
I suppose I could be clever and make a polygon that has no lines that cross, but I made a simple arrow out of a polygon with 4 or 5 lines, and it came out pretty awful. An image might not be a bad idea, but arrows drawn with lines seemed like the natural solution because they have to be resized and rotated a lot.
-
I think you can set the center of the other arrows two head lines to the middle of the other line, so they rotate around that.
This is a clever idea...I think I'll try it. Still, I don't see why there wouldn't be some sort of group option.