Pixels to hexagons

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
retrotails
Party member
Posts: 212
Joined: Wed Apr 18, 2012 12:37 am

Pixels to hexagons

Post by retrotails »

scrot.png
scrot.png (3.19 KiB) Viewed 3132 times
Very lazy way to convert pixels to a hexagonal grid. Spent less then 2 hours on it.
Hard coded hexagon shapes for speed and laziness.
Grid is stretched to fit the original aspect ratio.
Pixels are mapped 1-to-1 so there's no conversion. While it'd be easy with a canvas, I was only curious to see how sprite art looked.
Limited to images with 65536 pixels total (256x256) but you can disable it in the code.
The way hexagons are rendered one by one is just for looks, zoom or switch modes to render it instantly.

Controls:
Mouse wheel/Arrows: Browse items in the menu and zoom the image
Left click/Enter: Select the highlighted item
Right click/Escape: Return to menu, only Escape can quit.
1-4 keys: Change drawing mode
User avatar
SouL
Prole
Posts: 14
Joined: Mon Jun 30, 2014 1:33 pm

Re: Pixels to hexagons

Post by SouL »

Very interesting, thanks for sharing! :)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests