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
BaseTextureThe base texture source to create the texture from
-
frame
RectangleThe rectangle frame of the texture to show
Methods
emit
-
type
-
data
Emits an event which will run all registered listeners for the event type
Parameters:
-
type
StringThe event name to emit
-
data
MixedAny data you want passed along with the event
Returns:
Returns itself.
off
-
type
-
listener
Removes a listener function for an event type
Parameters:
-
type
StringThe event name to emit
-
listener
FunctionThe function to remove
Returns:
Returns itself.
on
-
type
-
listener
Registers a listener function to be run on an event occurance
Parameters:
-
type
StringThe event name to listen for
-
listener
FunctionThe function to execute when the event happens
Returns:
Returns itself.
once
-
type
-
listener
Registers a one-time callback for an event
Parameters:
-
type
StringThe event name to listen for
-
listener
Functionthe callback to call when the event occurs
Returns:
Returns itself.