Canvas:point(x, y, [ color ] ) method


Draws a point on the Canvas, at the specified position

Parameters

x

A number representing the horizontal position (zero means the left side of the Canvas)

y

A number representing the vertical position (zero means the top side of the Canvas)

[ color ]

An optional integer that represent a RGBA color value, defaulting to the current Canvas.color

Return value

This function returns no value.

Example

local ui = require "ui" require "canvas" ui.theme = "dark" -- create a simple Window local win = ui.Window("Canvas.point() sample - Move the mouse over the window", "fixed", 500, 400) -- create a Canvas local canvas = ui.Canvas(win) canvas.align = "all" function canvas:onHover(x, y, button) self:begin() --Draws a point at random coordinates with a random color self:point(x, y, math.random(0xFFFFFFFF)) self:flip() end ui.run(win):wait()