API Docs for: 1.0.1

Grape.SpriteVisualizer Class

Visualizes a sprite. If no sprite is set, draws a question mark to indicate the error.

Constructor

Grape.SpriteVisualizer

(
  • [opts]
)

Parameters:

  • [opts] Object optional

    Initial values of properties

Item Index

Methods

Methods

visualize

(
  • ctx
)

This abstract method is called each render frame if visible is set to true.

Parameters:

  • ctx CanvasRenderingContext2D

    The rendering context

Properties

alpha

Number

The alpha value set before calling the visualize method

Default: 1

sprite

Grape.Sprite

The sprite

subimage

Number

The image index of the sprite to show

Default: 0

visible

Number

If set false, the visualize method is not called.

Default: true