Scaling Objects #
Written by:
OmgRod
OwnerLua Trigger lets you interact with objects through group IDs. One of the ways you can interact with objects is by scaling them. An example of how to scale objects is below:
lua
1while true do2 Object.scale(3 5, -- Target group4 1, -- Center group5 2, -- Scale X6 2, -- Scale Y7 1, -- Duration8 0, -- Easing Type9 2, -- Easing Rate10 { -- Options11 relativeScale = true12 }13 )14end
The code above scales group 5 to 2x size with center group ID 1 over 1 second.
| Parameter | Type | Default | Description |
|---|---|---|---|
targetGroup | integer | - | Group to scale. |
centerGroup | integer | - | Scaling center. |
scaleX | number | - | Horizontal scale. |
scaleY | number | scaleX | Vertical scale. |
duration | number | 0 | Animation duration. |
easingType | integer | 0 | Easing type (look at easing type docs). |
easingRate | number | 2.0 | Easing rate (look at easing rate docs). |
options | table | {} | Extra scaling options. Look below for more properties. |
| Parameter | Type | Default | Description |
|---|---|---|---|
divByX | boolean | false | Divide scaling by the X scale. |
divByY | boolean | false | Divide scaling by the Y scale. |
onlyMove | boolean | false | Only move objects instead of resizing them. |
relativeScale | boolean | false | Apply the scale relative to the current scale. |
relativeRotation | boolean | false | Respect each object's current rotation while scaling. |
