The Texture this TextureSource belongs to.
The source image data.
Optionalwidth: numberOptional width of the source image. If not given it's derived from the source itself.
Optionalheight: numberOptional height of the source image. If not given it's derived from the source itself.
OptionalflipY: booleanSets the UNPACK_FLIP_Y_WEBGL flag the WebGL Texture uses during upload. Default true.
Holds the compressed textured algorithm, or null if it's not a compressed texture.
Prior to Phaser 3.60 this value always held null.
Sets the UNPACK_FLIP_Y_WEBGL flag the WebGL Texture uses during upload.
The wrapped WebGL Texture of the source image. If this TextureSource is driven from a WebGLTexture already, then this wrapper contains a reference to that WebGLTexture.
The height of the source image. If not specified in the constructor it will check
the naturalHeight and then height properties of the source image.
The image data.
This is either an Image element, Canvas element, Video Element, or Uint8Array.
Is the source image a Canvas Element?
Is the source image a WebGLTextureWrapper?
Are the source image dimensions a power of two?
Is the source image a Render Texture?
Is the source image a Video Element?
A reference to the Canvas or WebGL Renderer.
The resolution of the source image.
The Scale Mode the image will use when rendering. Either Linear or Nearest.
The source of the image data.
This is either an Image Element, a Canvas Element, a Video Element, a RenderTexture or a WebGLTextureWrapper.
In Phaser 3.60 and above it can also be a Compressed Texture data object.
The Texture this TextureSource instance belongs to.
The width of the source image. If not specified in the constructor it will check
the naturalWidth and then width properties of the source image.
Destroys this Texture Source and nulls the references.
Creates a WebGL Texture, if required, and sets the Texture filter mode.
A reference to the Phaser Game instance.
Sets the Filter Mode for this Texture.
The mode can be either Linear, the default, or Nearest.
For pixel-art you should use Nearest.
The Filter Mode.
Sets the UNPACK_FLIP_Y_WEBGL flag for the WebGL Texture during texture upload.
Optionalvalue: booleanShould the WebGL Texture be flipped on the Y axis on texture upload or not? Default true.
If this TextureSource is backed by a Canvas and is running under WebGL, it updates the WebGLTexture using the canvas data.
Updates the dimensions of this Texture Source. This is called automatically by game systems which manage textures, such as Text, which renders to a dedicated canvas that changes size.
The new width of the source image.
The new height of the source image.
A Texture Source is the encapsulation of the actual source data for a Texture.
This is typically an Image Element, loaded from the file system or network, a Canvas Element or a Video Element.
A Texture can contain multiple Texture Sources, which only happens when a multi-atlas is loaded.