Is there a way to create regular polygons?


Ive been using aseprite for a while. I thought I saw this in a tutorial sometime ago but I can’t figure out how to do it. To be more clear. A regular polygon would be one with the same length side on all sides. Like a triangle with all 60 degree angles or a square. a pentagon would have 5 72 degree angles and so on.

I’m assuming you’ve never found a solution? I’m trying to make a game based on hexagons so this would be incredibly useful.

Hi @ChildishGiant,

If you’re willing to use Aseprite scripts, I wrote a tutorial that addressed how to make regular convex polygons.

The basic idea is to convert the number of points to an angle in 0-360 degrees, then convert the angle to Cartesian coordinates, in other words (x, y) pairs. Then, translate, rotate and scale the polygon.

The complete scripts for both a regular polygon and for a hexagon grid can be found in this Github repository. You can probably just create one hexagon, then use the image as a template going forward.

The tutorial on Red Blob Games about hexagonal grids is pretty comprehensive if you’re making a grid for a game. It’s easier, imo, to create hex grids with decimals in your game engine than with integers in Aseprite, for reasons you should be able to see in the screen cap above.

Best to you,