Gamalto

Fork me on GitHub

Object SpriteSheet Overview

Gamalto. SpriteSheet

new Gamalto.SpriteSheet(bitmap)

Creates a set of sprites from a bitmap.

Parameters
Name Type Description
bitmap Gamalto.Bitmap

Image holding the sprites data.

Extends

Members

length :number

inherited readonly

Number of items in the list.

Inherited From

tag :object

inherited

Utility property to exchange data between objects.

Inherited From

Methods

addSections(size, countopt, ropt) Gamalto.SpriteSheet

override

Adds a new set of sprites to the list using the specified parameters.

Parameters
Name Type Attributes Description
size Gamalto.Size

Size of a sprite.

count number <optional>

Number of sprite sections to compute. Defaults to the number of sections contained in the specified rectangle.

r Gamalto.IBox <optional>

Rectangle defining the bounds of the container. Defaults to the bitmap bounds.

Overrides
Returns
  • Current object for method chaining.

clone() object

inherited abstract

Clones the object. It will be shallow copy unless otherwise specfied.

Inherited From
Returns
  • New instance of the object. Defaults to null.

draw(renderer, x, y, index)

abstract

Draws a sprite into a surface.

Parameters
Name Type Description
renderer Gamalto.BaseRenderer

Renderer of the surface where the sprite must be drawn.

x number

Horizontal drawing position.

y number

Vertical drawing position.

index number

Zero-based index of the sprite to be drawn.

getSection(index) object

inherited

Gets the section at the specified index.

Parameters
Name Type Description
index number

Zero-based index of the section.

Inherited From
Returns
  • Requested section. The type depends on the implementation.

insertSection(at, section)

inherited

Inserts an existing section into the list.

Parameters
Name Type Description
at number

Zero-based index where the section must be inserted.

section object

Section to be added. The type depends on the implementation.

Inherited From

setMargin(x, y)

inherited

Sets the global margin around the sections in the container.

Parameters
Name Type Description
x number

Horizontal margin.

y number

Vertical margin.

Inherited From

setSpacing(x, y)

inherited

Sets the spacing around a section in the container.

Parameters
Name Type Description
x number

Horizontal spacing between sections.

y number

Vertical spacing between sections.

Inherited From

toString() string

inherited abstract

Converts the object into a string.

Inherited From
Returns
  • string

Documentation generated by JSDoc 3.3.2 on Sun Sep 13 2015 20:13:31 GMT+0200 (CEST)