Class SpriteSheetAnimation

Handles a series of [[SpriteFrame]]s to be mapped onto a [[MeshSprite]] Contains the [[MeshSprite]], the [[Material]] and the spritesheet-texture

Constructors

Properties

frames: SpriteFrame[] = []
name: string
spritesheet: CoatTextured

Methods

  • Stores a series of frames in this [[Sprite]], calculating the matrices to use in the components of a [[NodeSprite]]

    Parameters

    • _rects: Rectangle[]
    • _resolutionQuad: number
    • _origin: ORIGIN2D

    Returns void

  • Add sprite frames using a grid on the spritesheet defined by a rectangle to start with, the number of frames, the resolution which determines the size of the sprites mesh based on the number of pixels of the texture frame, the offset from one cell of the grid to the next in the sequence and, in case the sequence spans over more than one row or column, the offset to move the start rectangle when the margin of the texture is reached and wrapping occurs.

    Parameters

    • _startRect: Rectangle
    • _frames: number
    • _resolutionQuad: number
    • _origin: ORIGIN2D
    • _offsetNext: Vector2
    • _offsetWrap: Vector2 = ...

    Returns void