Component_Animator Class
An animator-component allows to execute different kind of animations on a game object. The animations are using the game object's dstRect & offset-property to execute.
Item Index
Methods
Properties
Methods
appear
-
x
-
y
-
animation
-
easing
-
duration
-
[callback]
Lets a game object appear on screen using a specified animation.
Parameters:
-
x
NumberThe x-coordinate of the target-position.
-
y
NumberThe y-coordinate of the target-position.
-
animation
gs.AppearAnimationInfoThe animation info-object.
-
easing
ObjectThe easing-type.
-
duration
NumberThe duration in frames.
-
[callback]
Function optionalAn optional callback-function called when the animation is finished.
blendTo
-
opacity
-
duration
-
easingType
-
[callback]
Blends a game object to specified opacity.
Parameters:
-
opacity
NumberThe target opacity.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
-
[callback]
Function optionalAn optional callback called if blending is finished.
blendTo
-
param
-
value
-
duration
-
easingType
-
[callback]
Animates a Live2D model parameter of a Live2D game object to a specified value.
Parameters:
-
param
StringThe name of the parameter to animate.
-
value
NumberThe target value.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
-
[callback]
Function optionalAn optional callback called if blending is finished.
blurTo
-
power
-
duration
-
easingType
Blurs a game object to specified blur-power.
Parameters:
-
power
NumberThe target blur-power.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
change
-
Value
-
field
-
duration
-
easingType
Changes a field of the game object to a specified value.
Parameters:
-
Value
NumberThe target value.
-
field
StringThe name of the field/property.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
changeFrames
-
frames
-
duration
-
easingType
A frame animation which modifies the game object's srcRect property a play an animation.
Parameters:
-
frames
gs.RectAn array of source rectangles (frames).
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
changeImages
-
images
-
duration
-
easingType
An image animation runs from left to right using the game object's image-property.
Parameters:
-
images
ArrayAn array of image names.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
close
()
deprecated
Changes visible-property to false. This method is deprecated.
colorTo
-
color
-
duration
-
easingType
Colors a game object to a specified target color.
Parameters:
-
color
ColorThe target color.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
disappear
-
animation
-
easing
-
duration
-
[callback]
Lets a game object disappear from screen using a specified animation.
Parameters:
-
animation
gs.AppearAnimationInfoThe animation info-object.
-
easing
ObjectThe easing-type.
-
duration
NumberThe duration in frames.
-
[callback]
Function optionalAn optional callback-function called when the animation is finished.
flash
-
color
-
duration
Flashes the game object.
Parameters:
-
color
ColorThe flash-color.
-
duration
NumberThe duration in frames.
hide
-
duration
-
easing
-
[callback]
Lets a game object disappear from screen using blending.
Parameters:
-
duration
NumberThe duration in frames.
-
easing
ObjectThe easing-type.
-
[callback]
Function optionalAn optional callback-function called when the animation is finished.
maskIn
-
mask
-
duration
-
easingType
-
[callback]
Lets a game object appear on screen using a masking-effect.
Parameters:
-
mask
gs.MaskThe mask used for the animation.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
-
[callback]
Function optionalAn optional callback-function called when the animation is finished.
maskOut
-
mask
-
duration
-
easingType
-
[callback]
Lets a game object disappear from screen using a masking-effect.
Parameters:
-
mask
gs.MaskThe mask used for the animation.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
-
[callback]
Function optionalAn optional callback-function called when the animation is finished.
maskTo
-
mask
-
duration
-
easingType
-
[callback]
Description follows...
Parameters:
-
mask
gs.MaskThe mask used for the animation.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
-
[callback]
Function optionalAn optional callback-function called when the animation is finished.
move
-
speedX
-
speedY
-
duration
-
easingType
Moves the game object with a specified speed.
Parameters:
-
speedX
NumberThe speed on x-axis in pixels per frame.
-
speedY
NumberThe speed on y-axis in pixels per frame.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type used for the animation.
moveIn
-
x
-
y
-
type
-
duration
-
easingType
-
[callback]
Lets a game object appear on screen from left, top, right or bottom using a move-animation
Parameters:
-
x
NumberThe x-coordinate of the target-position.
-
y
NumberThe y-coordinate of the target-position.
-
type
NumberThe movement-direction from where the game object should move-in.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
-
[callback]
Function optionalAn optional callback-function called when the animation is finished.
moveOut
-
type
-
duration
-
easingType
-
[callback]
Lets a game object disappear from screen to the left, top, right or bottom using a move-animation
Parameters:
-
type
NumberThe movement-direction in which the game object should move-out.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
-
[callback]
Function optionalAn optional callback-function called when the animation is finished.
movePath
-
path
-
loopType
-
duration
-
easingType
-
effects
Moves the game object along a path.
Parameters:
-
path
ObjectThe path to follow.
-
loopType
gs.AnimationLoopTypeThe loop-Type.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
-
effects
ObjectOptional array of effects executed during the path-movement like playing a sound.
moveTo
-
x
-
y
-
duration
-
easingType
Moves the game object to a specified position.
Parameters:
-
x
NumberThe x-coordinate of the position.
-
y
NumberThe y-coordinate of the position.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
open
()
deprecated
Changes visible-property to true. This method is deprecated.
pixelateTo
-
width
-
height
-
duration
-
easingType
Pixelates a game object to specified pixel-size/block-size
Parameters:
-
width
Number- The target block-width
-
height
Number- The target block-height
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
playAnimation
-
frames
-
duration
-
easingType
A frame animation which modifies the game object's srcRect property a play an animation.
Parameters:
-
frames
gs.RectAn array of source rectangles (frames).
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
rotate
-
direction
-
speed
-
duration
-
easingType
Rotates the game object around its anchor-point.
Parameters:
-
direction
gs.RotationDirectionThe rotation-direction.
-
speed
NumberThe rotation speed in degrees per frame.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
rotateTo
-
angle
-
duration
-
easingType
Rotates the game object around its anchor-point to a specified angle.
Parameters:
-
angle
NumberThe target angle.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
scroll
-
speedX
-
speedY
-
duration
-
easingType
Scrolls the game object with a specified speed.
Parameters:
-
speedX
NumberThe speed on x-axis in pixels per frame.
-
speedY
NumberThe speed on y-axis in pixels per frame.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type used for the animation.
scrollPath
-
path
-
loopType
-
duration
-
easingType
Scrolls the game object along a path.
Parameters:
-
path
ObjectThe path to follow.
-
loopType
gs.AnimationLoopTypeThe loop-Type.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
scrollTo
-
x
-
y
-
duration
-
easingType
Scrolls the game object to a specified position.
Parameters:
-
x
NumberThe x-coordinate of the position.
-
y
NumberThe y-coordinate of the position.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
shake
-
range
-
speed
-
duration
-
easingType
Shakes the game object horizontally using the game object's offset-property.
Parameters:
-
range
gs.RangeThe horizontal shake-range.
-
speed
NumberThe shake speed.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
show
-
duration
-
easing
-
[callback]
Lets a game object appear on screen using blending.
Parameters:
-
duration
NumberThe duration in frames.
-
easing
ObjectThe easing-type.
-
[callback]
Function optionalAn optional callback-function called when the animation is finished.
tintTo
-
tone
-
duration
-
easingType
Tints the game object to a specified tone.
Parameters:
-
tone
ToneThe target tone.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
update
()
Updates the animator.
wobbleTo
-
power
-
speed
-
duration
-
easingType
Wobbles a game object to specified wobble-power and wobble-speed.
Parameters:
-
power
NumberThe target wobble-power.
-
speed
NumberThe target wobble-speed.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
zoomTo
-
x
-
y
-
duration
-
easingType
Zooms a game object to specified size.
Parameters:
-
x
NumberThe x-axis zoom-factor.
-
y
NumberThe y-axis zoom-factor.
-
duration
NumberThe duration in frames.
-
easingType
ObjectThe easing-type.
Properties
callback
Function
private
Standard Callback Routine