API Docs for: 0.2.0
Show:

Q.SpriteSheet Class

Extends Q.Class
Module: Quintus.Sprites

Sprite sheet class - generally instantiated with Q.sheet new new

Item Index

Methods

Methods

draw

(
  • ctx
  • x
  • y
  • frame
)

Draw a single frame at x,y on the provided context

Parameters:

  • ctx Context2D
  • x Float
  • y Float
  • frame Integer

extend

(
  • className
  • properties
  • [classMethods]
)

Inherited from Q.Class: lib/quintus.js:693

Create a new Class that inherits from this class

Parameters:

  • className String
  • properties Object
    • hash of properties (init will be the constructor)
  • [classMethods] Object optional
    • optional class methods to add to the class

fx

(
  • frame
)

Returns the starting x position of a single frame

Parameters:

  • frame Integer

fy

(
  • frame
)

Returns the starting y position of a single frame

Parameters:

  • frame Integer

init

(
  • name
  • asset
  • options
)

constructor

Options:

  • tileW - tile width
  • tileH - tile height
  • w - width of the sprite block
  • h - height of the sprite block
  • sx - start x
  • sy - start y
  • spacingX - spacing between each tile x (after 1st)
  • spacingY - spacing between each tile y
  • marginX - margin around each tile x
  • marginY - margin around each tile y
  • cols - number of columns per row

Parameters:

  • name String
  • asset String
  • options Object

isA

(
  • className
)

Inherited from Q.Class: lib/quintus.js:683

See if a object is a specific class

Parameters:

  • className String
    • class to check against