nanos world API Reference Unofficial documentation
Constructor Shared

Canvas.Default Constructor

Syntax

Lua
Canvas(is_visible = true, clear_color = Color.TRANSPARENT, auto_repaint_rate = -1, should_clear_before_update = true, auto_resize = true, width = 0, height = 0, screen_position = Vector2D(0, 0))

Parameters

Name Type Default Description
is_visible optional boolean true Whether to draw it on screen
clear_color optional Color Color.TRANSPARENT Color to clear with (background color)
auto_repaint_rate optional float -1 Rate to auto repaint (call Update event), pass 0 for every frame, -1 to disable
should_clear_before_update optional boolean true Whether to clear with Clear Color before updates
auto_resize optional boolean true Auto resize with screen's size
width optional integer 0 If not using auto_resize
height optional integer 0 If not using auto_resize
screen_position optional Vector2D Vector2D(0, 0) If not using auto_resize, offset when drawing to screen