Page 1 of 1

Pixels to hexagons

Posted: Mon Dec 22, 2014 5:03 am
by retrotails
scrot.png
scrot.png (3.19 KiB) Viewed 3193 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

Re: Pixels to hexagons

Posted: Sat Dec 27, 2014 9:40 pm
by SouL
Very interesting, thanks for sharing! :)