Provides functions to manipulate the main engine window.
Properties
| Name | Type | Description |
|---|---|---|
uid | integer |
monoe.io.window.new
Creates a new window.
Parameters
| Name | Type | Description |
|---|---|---|
_uid | integer|nil |
Returns
monoe.engine.window
monoe.io.window:title
Changes the title of the main window.
Parameters
| Name | Type | Description |
|---|---|---|
title | string | New window title |
monoe.io.window:size
Sets or queries the size of the main window.
Parameters
| Name | Type | Description |
|---|---|---|
width | number|nil | New width in pixels |
height | number|nil | New height in pixels |
Returns
integer current_widthinteger current_height
monoe.io.window:position
Sets or queries the position of the main window.
Parameters
| Name | Type | Description |
|---|---|---|
x | number|nil | New x position |
y | number|nil | New y position |
Returns
integer current_xinteger current_y
monoe.io.window:scale
Scales the window.
Parameters
| Name | Type | Description |
|---|---|---|
x | number | Scale factor X |
y | number | Scale factor Y |
Returns
integer scaled_widthinteger scaled_height
monoe.io.window:move
Moves the window by a relative offset.
Parameters
| Name | Type | Description |
|---|---|---|
dx | number | Horizontal offset |
dy | number | Vertical offset |
Returns
integer new_xinteger new_y
monoe.io.window:attach
Attaches an object or its children to the window for rendering.
Parameters
| Name | Type | Description |
|---|---|---|
obj | table | Object with `.uid` or `.root` property |
monoe.io.window:visible
Makes the window visible
Parameters
| Name | Type | Description |
|---|---|---|
state | boolean |
Returns
boolean
monoe.io.window:center
Returns the center coordinates of the window.
Returns
number center_xnumber center_y
monoe.io.window:close_request
Registers a callable that'll be called when a window closing is requested.
Parameters
| Name | Type | Description |
|---|---|---|
func | function | |
once | boolean|nil |