SFML community forums
Help => Graphics => Topic started by: Guardian on February 10, 2017, 10:38:51 pm
-
Hi all,
I'm new with SFML and I'm trying to learn how to make an hexagonal tile map.
I can't understand what primitive type I should use to draw a hexagon?
I've already thought to use a series of Triangle but if I do that I won't be able to set the correct texture to the tile.
Someone can help me?
-
You can draw anything* with triangles.
You can draw a hexagon simply (in a fan) with six triangles although you can actually draw one with just four.
Why can you not set the texture correctly? Just set the texture co-ordinates to match the points of the texture that they should.
*to a reasonable degree
-
Ok. I found the way to do that with Triangles. Thanks for your answer.
-
You're very welcome. Hope it becomes an awesome game! :)
-
Why not use a sf::CircleShape instead as shown in the official shapes tutorial (http://www.sfml-dev.org/tutorials/2.4/graphics-shape.php)?
PS. It's my first post so hello everyone :) Yes, the above was bothering me so much, that I immidiately registered xD