Canvas.y read/write property


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

local ui = require "ui" require "canvas" -- create a simple window local win = ui.Window("canvas.y sample", 600, 300) local canvas = ui.Canvas(win, 140, 0) ui.run(win) 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()