Update Types

entar 2025-06-10 12:23:05 +07:00
parent 9a51bf14da
commit 3dfe79a2b2

@ -50,6 +50,7 @@ Every update updates the sprite based on it's current animation and framerate.
- `Sprite.modifier` - number -- Scroll factor relative to camera position. 0-inf.
- `Sprite.layer` - number -- Layer that Sprite renders on.
- `Sprite.rotation` - number -- Sprite rotation.
- `Sprite.flipX` - boolean -- If sprite gets flipped on X axis. CHANGES SPRITE POSITION TO BE EXACTLY -width.
## Functions
- `Sprite:Destroy()` -- Removes the sprite from the list, won't render anymore. Cache still remains.
@ -70,10 +71,29 @@ Sprite, but doesn't play a animation and saves up space and game FPS.
- `Rect.modifier` - number -- Scroll factor relative to camera position. 0-inf.
- `Rect.layer` - number -- Layer that Rect renders on.
- `Rect.rotation` - number -- Rect rotation.
- `Rect.flipX` - boolean -- If rect gets flipped on X axis. CHANGES RECT POSITION TO BE EXACTLY -width.
# Functions
- `Rect:Destroy()` -- Removs the rect from the list, won't render anymore. Cache still remains.
- `Rect:Frame(string, number)` -- Sets the current animation and a frame for the Rect.
## Creation
myTypes.Rect(string, string) -- Image path, Atlas path
myTypes.Rect(string, string) -- Image path, Atlas path
# Character
Typically you wouldn't need to call this one, but it still needs to be here for the special people.
## Children:
- `Character.sprite` - Sprite -- Character sprite. Typically used for position changing or resizing.
- `Character.scale` - parsed.scale -- Character resize. Isn't applied yet, just change the scale directly.
- `Character.singing` - boolean -- Isn't used directly, but changes on PlayAnimation().
- `Character.stagePosition` - Vector2 -- Get's applied with stage.json positions in playstate.lua, if needed you can change that mid-events.
- `Character.stageCamera` - Vector2 -- Get's applied with json positions in character type function.
- `Character.flipX` - boolean -- Whenether does character get flipped or not (Sprite.flipX).
- `Character.beats` - number -- How many beats does GF character need to bop.
- `Character.animation` - string -- Isn't called directly. Changed in PlayAnimation().
- `Character.icon` - string -- Taken from json.
## Functions
- `Character:PlayAnimation(string)` -- Plays the animation based on json Name, FPS and Offsets.