reference monoe.stobj

Lua API Reference

Represents a static object that can move, scale, and be freed / removed / attached. Similar to monoe.entitys, this one if designed for objects.

Properties

NameTypeDescription
uidinteger

monoe.stobj.new


monoe.stobj:position

Gets or sets the position of the stobj in 2D space. If `x` and `y` are provided, the stobj is moved to that position.

Parameters

NameTypeDescription
xnumber|nilX-coordinate to set (optional)
ynumber|nilY-coordinate to set (optional)

Returns


monoe.stobj:move

Moves the stobj by applying a velocity. Automatically calls `MoveAndSlide` to update the stobj's position according to physics rules.

Parameters

NameTypeDescription
xnumberHorizontal velocity
ynumberVertical velocity

monoe.stobj:scale

Scales the stobj in X and Y directions.

Parameters

NameTypeDescription
xnumberScale factor along the X-axis
ynumberScale factor along the Y-axis

Returns


monoe.stobj:free

Releases engine resources used by this stobj. After calling this, the stobj should no longer be used.


monoe.stobj:remove

Removes the instance from the rendering side.


monoe.stobj:attach

Attaches another object (sprite, animation, or another stobj) to this stobj. The attached object will move and scale with the stobj.

Parameters

NameTypeDescription
objmonoe.image|monoe.sprite|monoe.animation|monoe.stobjObject to attach