-
Notifications
You must be signed in to change notification settings - Fork 7
Lua Script API: Object Functions
Spawns an colored screen
-
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 Hexadecimal 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
Adds an animation name to 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
Sets the object to overlap the layer position of the object
-
obj1
- The first object that will overlap the second object -
obj2
- The second object
Sets the object's layer position
-
obj
- Object variable/Lua Sprite tag -
position
- New position the object will be in
Gets the object's layer position
-
obj
- Object variable/Lua Sprite tag
(note: when referring to characters, you must refer to their group) boyfriendGroup
, gfGroup
, dadGroup
Removes a note group I think?
-
obj
- Group/Array variable -
index
- Member ID -
dontDestroy
- Optional variable. Won't clear member from memory, you will probably never ever use this.
Example: To remove the first spawned note from the group you should use removeFromGroup('notes', 0)
Sets the Graphic size by pixel
-
obj
- Object from PlayState or Lua Sprite -
multX
- Horizontal multiplier, default value is 1 -
multY
- Vertical multiplier, default value is 1
Sets the Object size by .scale
Use this to update the hitbox in case you change the sprite's scale manually or via a tween.
-
obj
- Object from PlayState or Lua Sprite
Resets the Sprite tag
-
tag
- The Lua Sprite you want to reset
Resets the Text tag
-
tag
- The Lua Text you want to reset
Changes how much a Sprite moves along with the camera.
-
obj
- Lua Sprite tag or Object variable name -
scrollX
- Horizontal movement multiplier -
scrollY
- Vertical movement multiplier
Note: Boyfriend/Opponent have a scrollX/scrollY value of 1, while Girlfriend have a scrollX/scrollY value of 0.95, if you're gonna do background elements, it's highly suggested that you make the values something under 1.
Changes on which camera should your object be drawn on
-
obj
- Lua Sprite tag or Object variable name -
camera
-camGame
,camHUD
orcamOther
Sets the object to center of the screen
-
obj
- The Sprite/Text tag or Object variable name -
pos
- The position you want to set in, it could be either:X
,Y
,XY
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