Canvas.enabled readwrite


Get or set the Canvas ability to respond to mouse, and any other events. When set to false, disable the Canvas (the user will not be able to interact with it), and Canvas's events won't be fired anymore.

Example

--! luart-extensions import ui require "canvas" -- create a simple Window local win = ui.Window("Canvas.enabled sample", 320, 200) local Canvas = ui.Canvas(win) Canvas.align = "all" -- disable the Canvas Canvas.enabled = false -- onClick event won't be fired as the Canvas is disabled function Canvas:onClick(x, y) ui.info("You have clicked on the Canvas at position "..x..", "..y) end await win:showasync()