Screen:initiate()
Set the bounds of a screen object in screen pixels.
Signature
initiate(x: number, y: number, width: number, height: number): void
Parameters
| Parameter | Type | Description |
|---|---|---|
| x | number | Left edge in pixels |
| y | number | Top edge in pixels |
| width | number | Width in pixels |
| height | number | Height in pixels |
Returns
void
Description
This is the low-level method the app uses to initialize a Screen() object. Macros usually
create a region with Region(x, y, width, height) instead, which calls initiate() for you.
Call it directly only when reusing an existing object with new bounds.
Example
local area = Region(0, 0, 100, 100)
area:initiate(100, 200, 300, 400)
toast(area:width() .. " x " .. area:height())