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:
-
xNumberThe x-coordinate of the target-position.
-
yNumberThe y-coordinate of the target-position.
-
animationgs.AppearAnimationInfoThe animation info-object.
-
easingObjectThe easing-type.
-
durationNumberThe 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:
-
opacityNumberThe target opacity.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe 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:
-
paramStringThe name of the parameter to animate.
-
valueNumberThe target value.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe 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:
-
powerNumberThe target blur-power.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
change
-
Value -
field -
duration -
easingType
Changes a field of the game object to a specified value.
Parameters:
-
ValueNumberThe target value.
-
fieldStringThe name of the field/property.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
changeFrames
-
frames -
duration -
easingType
A frame animation which modifies the game object's srcRect property a play an animation.
Parameters:
-
framesgs.RectAn array of source rectangles (frames).
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
changeImages
-
images -
duration -
easingType
An image animation runs from left to right using the game object's image-property.
Parameters:
-
imagesArrayAn array of image names.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe 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:
-
colorColorThe target color.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
disappear
-
animation -
easing -
duration -
[callback]
Lets a game object disappear from screen using a specified animation.
Parameters:
-
animationgs.AppearAnimationInfoThe animation info-object.
-
easingObjectThe easing-type.
-
durationNumberThe duration in frames.
-
[callback]Function optionalAn optional callback-function called when the animation is finished.
flash
-
color -
duration
Flashes the game object.
Parameters:
-
colorColorThe flash-color.
-
durationNumberThe duration in frames.
hide
-
duration -
easing -
[callback]
Lets a game object disappear from screen using blending.
Parameters:
-
durationNumberThe duration in frames.
-
easingObjectThe 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:
-
maskgs.MaskThe mask used for the animation.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe 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:
-
maskgs.MaskThe mask used for the animation.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
-
[callback]Function optionalAn optional callback-function called when the animation is finished.
maskTo
-
mask -
duration -
easingType -
[callback]
Description follows...
Parameters:
-
maskgs.MaskThe mask used for the animation.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe 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:
-
speedXNumberThe speed on x-axis in pixels per frame.
-
speedYNumberThe speed on y-axis in pixels per frame.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe 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:
-
xNumberThe x-coordinate of the target-position.
-
yNumberThe y-coordinate of the target-position.
-
typeNumberThe movement-direction from where the game object should move-in.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe 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:
-
typeNumberThe movement-direction in which the game object should move-out.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe 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:
-
pathObjectThe path to follow.
-
loopTypegs.AnimationLoopTypeThe loop-Type.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
-
effectsObjectOptional 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:
-
xNumberThe x-coordinate of the position.
-
yNumberThe y-coordinate of the position.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe 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:
-
widthNumber- The target block-width
-
heightNumber- The target block-height
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
playAnimation
-
frames -
duration -
easingType
A frame animation which modifies the game object's srcRect property a play an animation.
Parameters:
-
framesgs.RectAn array of source rectangles (frames).
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
rotate
-
direction -
speed -
duration -
easingType
Rotates the game object around its anchor-point.
Parameters:
-
directiongs.RotationDirectionThe rotation-direction.
-
speedNumberThe rotation speed in degrees per frame.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
rotateTo
-
angle -
duration -
easingType
Rotates the game object around its anchor-point to a specified angle.
Parameters:
-
angleNumberThe target angle.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
scroll
-
speedX -
speedY -
duration -
easingType
Scrolls the game object with a specified speed.
Parameters:
-
speedXNumberThe speed on x-axis in pixels per frame.
-
speedYNumberThe speed on y-axis in pixels per frame.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type used for the animation.
scrollPath
-
path -
loopType -
duration -
easingType
Scrolls the game object along a path.
Parameters:
-
pathObjectThe path to follow.
-
loopTypegs.AnimationLoopTypeThe loop-Type.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
scrollTo
-
x -
y -
duration -
easingType
Scrolls the game object to a specified position.
Parameters:
-
xNumberThe x-coordinate of the position.
-
yNumberThe y-coordinate of the position.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
shake
-
range -
speed -
duration -
easingType
Shakes the game object horizontally using the game object's offset-property.
Parameters:
-
rangegs.RangeThe horizontal shake-range.
-
speedNumberThe shake speed.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
show
-
duration -
easing -
[callback]
Lets a game object appear on screen using blending.
Parameters:
-
durationNumberThe duration in frames.
-
easingObjectThe 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:
-
toneToneThe target tone.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
update
()
Updates the animator.
wobbleTo
-
power -
speed -
duration -
easingType
Wobbles a game object to specified wobble-power and wobble-speed.
Parameters:
-
powerNumberThe target wobble-power.
-
speedNumberThe target wobble-speed.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
zoomTo
-
x -
y -
duration -
easingType
Zooms a game object to specified size.
Parameters:
-
xNumberThe x-axis zoom-factor.
-
yNumberThe y-axis zoom-factor.
-
durationNumberThe duration in frames.
-
easingTypeObjectThe easing-type.
Properties
callback
Function
private
Standard Callback Routine
