-
Notifications
You must be signed in to change notification settings - Fork 7
Lua Script API: Object Functions
Creates a colored screen.
-
tag
- The sprite tag or object variable name. -
width
- The width value in pixels of the colored screen. -
height
- The height value in pixels of the colored screen. -
color
- The color of the colored screen. (Must be a Hexadecimal Color Code)
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 object. (Works similar to how Photoshop do it)
-
obj
- The sprite tag or object variable name. -
blend
- The 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.
-
tag
- The sprite tag or object variable name. -
name
- The animation name to played. -
prefix
- The animation name on thexml
file. -
framerate
- An optional value, how many frames per second does the animation have, Default value is24
. -
loop
- An optional value, This will loop the animation, Default value istrue
.
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
- The sprite tag or object variable name. -
name
- The animation name to played. -
prefix
- The animation name on thexml
file. -
indices
- The frames for the animation that should be used, must be separated each by a comma, Example:1, 2, 3, 4, 5, 6
. -
framerate
- An optional value, how many frames per second does the animation have, Default value is24
Plays animation name on a lua sprite/object with the tag or variable object.
-
obj
- The sprite tag or object variable name. -
name
- The animation name to played. -
forced
- Iftrue
, if the current animation is the same as the one you're attempting to play, the animation will be reset, Default value isfalse
.
An alternate version of objectPlayAnimation()
-
obj
- The sprite tag or object variable name. -
name
- The animation name to played. -
forced
- Iftrue
, if the current animation is the same as the one you're attempting to play, the animation will be reset, Default value isfalse
. -
reverse
- Will reverse the animation. -
startFrame
- The starting frame on the animation to played.
If the object is overlaping on a another object it will return true
, if not then false
.
-
obj1
- The main object. -
obj2
- The object that will overlap the main object.
Sets the object's layer position.
-
obj
- The sprite tag or object variable name. -
position
- The new position order of the object.
Note: when referring to characters, you must refer to their group boyfriendGroup
, gfGroup
, dadGroup
.
Gets the object's layer position.
-
obj
- The sprite tag or object variable name.
Sets the graphic size by pixel.
-
obj
- The sprite tag or object variable/playstate 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 object size by .scale
property.
-
obj
- The sprite tag or object variable/playstate 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
.
Use this to update the hitbox in case you change the sprite's scale manually or via a tween.
-
obj
- The sprite tag or object variable/playstate name.
Resets the current sprite tag that is being used.
-
tag
- The sprite tag or object variable name.
Resets the current text tag that is being used.
-
tag
- The text tag or object variable name.
Changes how much a sprite moves along with the camera.
-
obj
- The sprite tag or object variable name. -
scrollX
- The x value of the scroll factor. -
scrollY
- The y value of the scroll factor.
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
- The sprite tag or object variable name. -
camera
- Can be eithercamGame
,camHUD
orcamOther
.
Adds an offset of the animation.
-
obj
- The sprite tag or object variable name. -
anim
- The animation name to played. -
x
- the new x value of the animation. -
y
- the new x value of the animation.
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