API Docs for: 1.13.1
Show:

game.SpriteSheet Class

Extends game.Class
Module: renderer

Constructor

game.SpriteSheet

(
  • id
  • width
  • height
)

Parameters:

  • id String

    Asset ID

  • width Number

    Sprite frame width

  • height Number

    Sprite frame height

Item Index

Properties

Methods

anim

(
  • frames
  • [startIndex]
  • [onlyTextures]
)
game.Animation | Array

Create animation from spritesheet.

Parameters:

  • frames Number | Array

    List or number of frames

  • [startIndex] Number optional

    The index to begin with, default to 0

  • [onlyTextures] Boolean optional

    Return only textures

Returns:

game.Animation | Array:

extend

(
  • prop
)
game.Class

Inherited from game.Class: engine/core.js:757

Extend class.

Parameters:

  • prop Object

Returns:

frame

(
  • index
)
game.Sprite

Create sprite from specific frame.

Parameters:

  • index Number

    Frame index

Returns:

init

(
  • arguments
)

Inherited from game.Class: engine/core.js:811

This method is called, when you create new instance of the class.

Parameters:

  • arguments Array

inject

(
  • prop
)

Inherited from game.Class: engine/core.js:825

Inject class.

Parameters:

  • prop Object

staticInit

(
  • arguments
)

Inherited from game.Class: engine/core.js:795

This method is called before init.

Parameters:

  • arguments Array

Properties

frames

Number

Number of frames