API Docs for:
Show:

Component_PathAnimation Class

Module: gs

Executes a path-animation on a game-object. A path-animation moves the game-object along a path of quadratic bezier-curves.

Methods

movePath

(
  • path
  • loopType
  • duration
  • easingType
  • [callback]
)

Starts the path-animation.

Parameters:

  • path Object

    The path to follow.

  • loopType gs.AnimationLoopType

    The loop-Type.

  • duration Number

    The duration in frames.

  • easingType Object

    The easing-type.

  • [callback] Function optional

    An optional callback called if blending is finished.

quadraticBezierPoint

(
  • startPt
  • controlPt
  • endPt
  • percent
)
protected

Calculates a certain point on a specified bezier-curve.

Parameters:

  • startPt Number
    • The start-point of the bezier-curve.
  • controlPt Number
    • The control-point of the bezier-curve.
  • endPt Number
    • The end-point of the bezier-curve.
  • percent Number
    • The percentage (0.0 - 1.0). A percentage of 0.0 returns the startPt and 1.0 returns the endPt while 0.5 return the point at the middle of the bezier-curve.

scrollPath

(
  • path
  • loopType
  • duration
  • easingType
  • [callback]
)

Starts the path-animation. Scrolls the game object along the path.

Parameters:

  • path Object

    The path to follow.

  • loopType gs.AnimationLoopType

    The loop-Type.

  • duration Number

    The duration in frames.

  • easingType Object

    The easing-type.

  • [callback] Function optional

    An optional callback called if blending is finished.

skip

()

Skips the animation. That is used to skip an animation if the user wants to skip very fast through a visual novel scene.

toDataBundle

()

Serializes the path-animation into a data-bundle.

update

()

Updates the path-animation.