-
Notifications
You must be signed in to change notification settings - Fork 7
Lua Script API: Object Functions
Will create an object with a solid color.
-
tag
- The sprite tag or object variable name. -
width
- The width value in pixels of the object. -
height
- The height value in pixels of the object. -
color
- The hexadecimal color of the object.
Example: makeGraphic('testBlackSquare', 1000, 1000, '000000')
Changes the blend mode of a lua sprite/object. (Works similar to how Photoshop do it)
-
obj
- The sprite tag or object variable name. -
blend
- The blend mode to be used.
Plays animation name on a lua sprite/object with the tag or variable object.
-
obj
- The sprite tag or object variable name. -
name
- The name of the animation to be used. -
forced
- If set totrue
, then the current animation is the same as the one you're attempting to play, the animation will be reset, Default value isfalse
. -
reverse
- An optional parameter, Will reverse the animation when played. -
startFrame
- An optional parameter, The starting frame of the animation to be played.
Note: This will only play the first prefix name on the
xml
file.
Adds an animation to the lua sprite/object with the specified indices on the indices
parameter; it can override an animation. If there are using the same name on the name
parameter.
-
obj
- The sprite tag or object variable name. -
name
- The name of the animation to be used. -
frames
- The frames for the animation that should be used, Example:{1, 2, 3}
-
framerate
- How many frames per second does the animation have, Default value is24
. -
loop
- This will loop the animation, Default value istrue
.
Adds an animation to the lua sprite/object without the specified indices; it can override an animation. If there are using the same name on the name
parameter.
-
tag
- The sprite tag or object variable name. -
name
- The name of the animation to be used. -
prefix
- The name of the animation inside of thexml
file. -
framerate
- How many frames per second does the animation have, Default value is24
. -
loop
- This will loop the animation, Default value istrue
.
Adds an animation to the lua sprite/object with the specified indices on indices
parameter; it can override an animation. If there are using the same name on the name
parameter.
If you want the looped version of this function use addAnimationByIndicesLoop()
; all parameters and use are the same.
-
obj
- The sprite tag or object variable name. -
name
- The name of the animation to be used. -
prefix
- The name of the animation inside of thexml
file. -
indices
- The frames for the animation that should be used, must be separated each by a comma, Example:1, 2, 3
-
framerate
- How many frames per second does the animation have, Default value is24
Adds an offset to the lua sprite/object.
-
obj
- The sprite tag or object variable name. -
anim
- The name of the animation to be used. -
x
- the new x value of the animation. -
y
- the new y value of the animation.
Sets the current lua sprite/object with a new layer value position.
If you want the character group use boyfriendGroup
, gfGroup
, and dadGroup
. They can be placed in the obj
or the position
parameters.
-
obj
- The sprite tag or object variable name. -
position
- The new layer position order of the object.
Gets the current lua sprite/object current layer value position.
-
obj
- The sprite tag or object variable name.
Checks if two lua sprite/object are overlaping eachother, Will return false
if not.
-
obj1
- The first lua sprite/object tag. -
obj2
- The second lua sprite/object tag.
Sets the lua sprite/object size by pixel width or height.
-
obj
- The sprite tag or object variable name. -
multX
- The width of the object to be set, Default value is1
. -
multY
- The heigth of the object to be set, Default value is1
.
Sets the lua sprite/object size by scale property.
-
obj
- The sprite tag or object variable name. -
multX
- The width of the object to be set, Default value is1
. -
multY
- The heigth of the object to be set, Default value is1
.
Updates the lua sprite/object hitboxes, use this if you're changing the scale of the lua sprite/object.
-
obj
- The sprite tag or object variable name.
Gets the lua sprite/object current midpoint hitbox x value.
-
variable
- The sprite tag or object variable name.
Gets the lua sprite/object current midpoint hitbox y value.
Gets the lua sprite/object current midpoint graphic x value.
Gets the lua sprite/object current midpoint graphic y value.
Gets the lua sprite/object current x position value
Gets the lua sprite/object current y position value
Sets the lua sprite/object to center with the pos
parameter.
-
obj
- The sprite tag or object variable name. -
pos
- The position you want to set in, it could be either:X
,Y
,XY
.
Note: Boyfriend/Opponent have a scrollX/scrollY value of
1
, while Girlfriend have a scrollX/scrollY value of0.95
, if you're gonna do background elements, it's highly suggested that you make the values something under1
.
Changes the lua sprite/object that moves along the camera when switching to characters.
-
obj
- The sprite tag or object variable name. -
scrollX
- The x value of the scroll factor to be set. -
scrollY
- The y value of the scroll factor to be set.
Sets the lua sprite/object camera state.
-
obj
- The sprite tag or object variable name. -
camera
- The camera state to be set in, Can be eithercamGame
,camHUD
orcamOther
.
Removes all of a specific note type.
-
obj
- The current strum group type. -
index
- The Member ID of the note to be removed, Opponent:0,1,2,3
and Player:4,5,6,7
. -
dontDestroy
- An optional parameter. Won't clear the 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)
.
Updates the note group hitboxes.
-
group
- The current strum group type. -
index
- The Member ID of the note to be updated, Opponent:0,1,2,3
and Player:4,5,6,7
.
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