Canvas.height read/write property


Get or set the height of the Canvas area. The height starts from 0 (top side of the Canvas) and increase to the bottom direction.

Example

local ui = require "ui" require "canvas" -- create a simple window local win = ui.Window("Canvas.x sample", 600, 400) local Canvas = ui.Canvas(win) Canvas.align = "all" function Canvas:onPaint() canvas:clear() self:fillellipse(300,200, 50, 50, 0xdc4f2bff) end -- shows the window win:show() -- update user interface and increase Canvas horizontal position repeat ui.update() Canvas.height = Canvas.height - 5 until not win.visible or (Canvas.height == 0)