new PIXI.BaseRenderTexture(width, height, scaleMode, resolution)
| Name | Type | Default | Description |
|---|---|---|---|
width |
number | 100 |
optional
The width of the base render texture |
height |
number | 100 |
optional
The height of the base render texture |
scaleMode |
number | PIXI.settings.SCALE_MODE |
optional
See PIXI.SCALE_MODES for possible values |
resolution |
number | 1 |
optional
The resolution / device pixel ratio of the texture being generated |
Extends
Methods
-
inherited _loadSvgSource()
-
Checks if
sourceis an SVG image and whether it's loaded via a URL or a data URI. Then calls_loadSvgSourceUsingDataUrior_loadSvgSourceUsingXhr. -
inherited _loadSvgSourceUsingDataUri(dataUri)
-
Reads an SVG string from data URI and then calls
_loadSvgSourceUsingString.Name Type Description dataUristring The data uri to load from.
-
inherited _loadSvgSourceUsingString(svgString)
-
Loads texture using an SVG string. The original SVG Image is stored as
origSourceand the
created canvas is the newsource. The SVG is scaled usingsourceScale. Called by_loadSvgSourceUsingXhror_loadSvgSourceUsingDataUri.Name Type Description svgStringstring SVG source as string
Fires:
- event:loaded
-
inherited _loadSvgSourceUsingXhr()
-
Loads an SVG string from
imageUrlusing XHR and then calls_loadSvgSourceUsingString. -
inherited _updateImageType()
-
Updates type of the source image.
-
destroy()
-
Destroys this texture
-
inherited dispose()
-
Frees the texture from WebGL memory without destroying this texture object.
This means you can still use the texture later which will upload it to GPU
memory again. -
inherited protectedloadSource(source)
-
Load a source.
If the source is not-immediately-available, such as an image that needs to be
downloaded, then the 'loaded' or 'error' event will be dispatched in the future
andhasLoadedwill remain false after this call.The logic state after calling
loadSourcedirectly or indirectly (eg.fromImage,new BaseTexture) is:if (texture.hasLoaded) { // texture ready for use } else if (texture.isLoading) { // listen to 'loaded' and/or 'error' events on texture } else { // not loading, not going to load UNLESS the source is reloaded // (it may still make sense to listen to the events) }Name Type Description sourceHTMLImageElement | HTMLCanvasElement the source object of the texture.
-
resize(width, height)
-
Resizes the BaseRenderTexture.
Name Type Description widthnumber The width to resize to.
heightnumber The height to resize to.
-
inherited update()
-
Updates the texture on all the webgl renderers, this also assumes the src has changed.
Fires:
- event:update
-
inherited updateSourceImage(newSrc)
-
Changes the source image of the texture.
The original source must be an Image element.Name Type Description newSrcstring the path of the image
Events
-
Fired when a not-immediately-available source fails to load.
-
Fired when a not-immediately-available source finishes loading.