API Docs for: v0.1.0
Show:

Texture Class

A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. It is used to desribe how a Sprite looks. If no frame is provided then the whole image is used. This is directly exposing PIXI.Texture though it does add some extra methods.

Constructor

Texture

(
  • baseTexture
  • frame
)

Parameters:

  • baseTexture BaseTexture

    The base texture source to create the texture from

  • frame Rectangle

    The rectangle frame of the texture to show

Item Index

Methods

Methods

emit

(
  • type
  • data
)
Mixed chainable

Emits an event which will run all registered listeners for the event type

Parameters:

  • type String

    The event name to emit

  • data Mixed

    Any data you want passed along with the event

Returns:

Mixed:

Returns itself.

off

(
  • type
  • listener
)
Mixed chainable

Removes a listener function for an event type

Parameters:

  • type String

    The event name to emit

  • listener Function

    The function to remove

Returns:

Mixed:

Returns itself.

on

(
  • type
  • listener
)
Mixed chainable

Registers a listener function to be run on an event occurance

Parameters:

  • type String

    The event name to listen for

  • listener Function

    The function to execute when the event happens

Returns:

Mixed:

Returns itself.

once

(
  • type
  • listener
)
Mixed chainable

Registers a one-time callback for an event

Parameters:

  • type String

    The event name to listen for

  • listener Function

    the callback to call when the event occurs

Returns:

Mixed:

Returns itself.