britzl / template-lowres

Defold template project for lowres/pixel-art games.
26 stars 3 forks source link

Add coordinate conversion helper for GUI picking, & demo script #14

Closed rgrams closed 1 year ago

rgrams commented 1 year ago

Solves issue #13.

Since the GUI is drawn to a render texture and then scaled in the render script, normal input coordinates don't work, and the conversion formula to get the correct coordinates is decidedly not obvious.

This pull request adds a small module to do that math for you, its minimal integration into the render script, and a sample script for the default example scene to show how it can be used.

britzl commented 1 year ago

Thanks! Great addition!