Skip to main content

The "sys_orig_init" Function

Syntax#

sys_orig_init(entity, index, xorig, yorig);
ArgumentTypeDescription
entityintegerThe data structure of the entity to set origin of
indexintegerThe index of the row containing the target entity
xorigreal/macroThe horizontal texture offset, or origin point, relative to the top-left corner
yorigreal/macroThe horizontal texture offset, or origin point, relative to the top-left corner

Description#

Applies the given origin points to the input entity on initialization. Origin can be set as either a literal value in pixels, or calculated automatically to set origins to left, top, center, right, or bottom.

As this script is run automatically by any actions that allow setting origins, it is almost never necessary to run sys_orig_init manually.

See Macros & Keywords for a list of available automatic origin modes.