Draw pictures using Lua.
Lua 5.4
SDL3
This should be the first drawing function called. canvas_size is how many virtual pixels wide and tall to make the screen. Make it big to make the virtual pixels small, and make it small to make the virtual pixels big. window_size is the number of pixels wide and tall the window will be that contains the canvas.
This function sets the color of the cursor. rgbColor is a 24-bit number. Bits 31-16 are an 8-bit number that sets the red brightness. Bits 15-8 are an 8-bit number that sets the green brightness. Bits 7-0 are an 8-bit number that sets the blue brightness.
This function sets the position of the cursor. The origin (0, 0) is the top-left of the screen. A large value of x will place the cursor on the right of the canvas. A large value of y will place the cursor near the bottom of the canvas. If x is 9 and the size of the canvas is 10, then the cursor will be on the right edge of the canvas.
Paints the pixel at the position the cursor is at. It will have the color the cursor was previously set to.
Move the cursor up.
Move the cursor down.
Move the cursor left.
Move the cursor right.
This might be useful for long drawing routines. It draws the contents of the canvas on the screen and also checks to see if the window has been closed.