pixi.textures.BaseTexture

type
class
extends
pixi.utils.EventTarget
subclasses
pixi.textures.VideoTexture
metadata
:native
"PIXI.BaseTexture"

Static Methods

fromCanvas(canvas : pixi.CanvasElement, ?scaleMode : Int) : BaseTexture

parameters
canvas {Canvas} The canvas element source of the texture
scaleMode {Int} Should be one of the PIXI.scaleMode consts
returns
BaseTexture
Helper function that returns a base texture based on a canvas element If the image is not in the base texture cache it will be created and loaded

fromImage(imageUrl : String, ?crossorigin : Bool, ?scaleMode : Int) : BaseTexture

parameters
imageUrl {String} The image url of the texture
crossorigin {Bool}
scaleMode {Int} Should be one of the PIXI.scaleMode consts
returns
BaseTexture
Helper function that returns a base texture based on an image url If the image is not in the base texture cache it will be created and loaded

Constructor

new(source : String, scaleMode : Int)
parameters
source {String} the source object (image or canvas)
scaleMode {Int} Should be one of the PIXI.scaleMode consts
A texture stores the information that represents an image. All textures have a base texture

Instance Variables hide inherited show inherited

hasLoaded : Bool

read-only Describes if the base texture has loaded or not

height : Float

read-only The height of the base texture set when the image has loaded

imageUrl : String

premultipliedAlpha : Bool

resolution : Float

The Resolution of the texture.

scaleMode : Float

The scale mode to apply when scaling this texture

source : Dynamic

The source that is loaded to create the texture

width : Float

read-only The width of the base texture set when the image has loaded

Instance Methods hide inherited show inherited

addEventListener(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget

destroy() : Void

Destroys this base texture

dirty() : Void

Sets all glTextures to be dirty.

dispatchEvent(eventName : String, ?data : Dynamic) : Bool

inherited from pixi.utils.EventTarget

emit(eventName : String, ?data : Dynamic) : Bool

inherited from pixi.utils.EventTarget
parameters
eventName {String} The name of the event.
data {Dynamic}
returns
{Bool} Indication if we've emitted an event.
Emit an event to all registered event listeners.

listeners(eventName : String) : Array<Dynamic>

inherited from pixi.utils.EventTarget
parameters
eventName {String} The events that should be listed.
returns
{Array} An array of listener functions
Return a list of assigned event listeners.

off(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} The event we want to remove.
callback {Function} The listener that we need to find.
Remove event listeners.

on(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} Name of the event.
callback {Functon} Callback function.
Register a new EventListener for the given event.

once(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} Name of the event.
callback {Function} Callback function.
Add an EventListener that's only called once.

removeAllEventListeners(eventName : String) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} The event you want to remove all listeners for.
Remove all listeners or only the listeners for the specified event.

removeEventListener(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget

updateSourceImage(newSrc : String) : Void

parameters
newSrc {String} the path of the image
Changes the source image of the texture