A render script for Defold (1.7.0) that draws to a low-resolution render target in 2D or 3D. It handles resizing the window by maintaining an internal vertical resolution.
After setting the render file to /derez/derez.render in the bootstrap settings, add /derez/derez.go to the main collection. The resolution_y property in the script for derez.go sets the vertical resolution for the project. The resolution can also be changed during runtime like so:
msg.post('@render:', 'set_resolution', {new_y = 240})
To install Derez into your project, add one of the following links to your game.project dependencies:
Derez is ready to receive these render messages in scripts:
msg.post('@render:', 'set_resolution')- Changes the vertical resolution Derez uses for renderingmsg.post('@render:', 'clear_color')- Changes the clear colormsg.post('@render:', 'use_camera_projection')- Enables 3D perspective view from a camera (default message)msg.post('@render:', 'use_2D_projection')- Disables 3D perspective view, returning to default
