Canvas.y readwrite


Get or set the Canvas vertical position. The vertical position start from 0 (top side of the parent widget) and increase to the bottom side of the parent widget.

Example

--! luart-extensions import ui require "canvas" -- create a simple window local win = ui.Window("canvas.y sample", 600, 300) local canvas = ui.Canvas(win, 140, 0) await win:showasync() async(function() while win.visible and (canvas.y < 282) do canvas.y = canvas.y + 2 canvas:begin() canvas:clear(math.random(0xFFFFFFFF)) canvas:flip() sleep(5) win:status("y = "..canvas.y) end sys.exit() end) waitall()