Canvas.x read/write property


Get or set the Canvas horizontal position. The horizontal position start from 0 (left side of the parent widget) and increase to the right (right side of the parent widget).

Example

local ui = require "ui" require "canvas" -- create a simple window local win = ui.Window("canvas.x sample", 600, 300) local canvas = ui.canvas(win) -- shows the window win:show() -- update user interface and increase canvas horizontal position repeat ui.update() canvas.x = canvas.x + 1 until not win.visible or (canvas.x > 600)