-
Notifications
You must be signed in to change notification settings - Fork 7
Lua Script API: Object Functions
Spawns a graphic with no image
-
tag
- Lua Sprite tag or Object variable name -
width
- the width of the sprite object -
height
- the height of the sprite object -
color
- the color of the sprite object, must be a hex color!
Example: Use makeGraphic('testBlackSquare', 1000, 1000, '000000') to make the Lua Sprite with the tag "testBlackSquare" turn into a 1000x1000 black square.
Changes the blend mode of a Sprite (Works similar to how Photoshop do it)
-
obj
- Lua Sprite tag or Object variable name -
blend
- Blend mode to use. Example: add, darken, normal. List of blend modes
Changes the size of the graphic
-
obj
- Lua Sprite tag or Object variable name -
x
- the x-coordinate of the sprite object -
y
- the x-coordinate of the sprite object -
updateHitbox
- iftrue
will change the sprite's scale manually or via a tween.
Adds an animation nameto the Lua Sprite/Object using the tag/variable tag, it will also overwrite another animation using the same name.
-
obj
- Lua Sprite tag or Object variable name -
name
- Animation to be added's name -
prefix
- Animation name on the .xml file -
framerate
- Optional value, how many frames per second does the animation have, Default value is 24 -
loop
- Optional value, should the animation loop? Default value: true
Adds an animation name to the Lua Sprite/Object using the tag/variable tag with the specified indices on indices, it will also overwrite another animation using the same name.
-
obj
- Lua Sprite tag or Object variable name -
name
- Animation to be added's name -
prefix
- Animation name on the .xml file -
indices
- What frames the animation should use, must be separated with a comma. Example: 1, 2, 3, 4, 5, 3, 4, 5 -
framerate
- Optional value, how many frames per second does the animation have, Default value is 24
Plays animation name on a Lua Sprite/Object with the tag/variable obj.
-
obj
- Lua Sprite tag or Object variable name -
name
- Animation name to play -
forced
- If true, the animation will reset if the current animation is the same as the one you're trying to play. Default value is false
Is the page in some way inaccurate? an error, a typo, or outdated data? To report it, use the "Issue Tab". Or do you wish to include a new function or add new information? use the "Pull Request Tab". Help is always appreciated!
- Event Callbacks
- Custom Sprite
- Custom Text
- Object Functions
- General Functions
- Scripting & File Functions
- Game Input Control Functions
- Language Translation
- HScript Functions
- Custom Substates
- Custom Shaders
- Deprecated & Removed Functions
- Sound & Music Functions
- Tweens & Timers Functions
- Reflection Functions
- Variables