Updated to PixiJS v5.
This commit is contained in:
@@ -126,7 +126,7 @@
|
||||
app.scene.addChild(deepZoomImage)
|
||||
|
||||
//Set info text.
|
||||
info.innerHTML = "resolution: " + app._options.resolution +
|
||||
info.innerHTML = "resolution: " + app.renderer.resolution +
|
||||
"<br>high resolution: " + !!state;
|
||||
}
|
||||
|
||||
|
||||
@@ -595,7 +595,7 @@ export class DeepZoomImage extends PIXI.Container {
|
||||
* @return {Sprite} sprite - A sprite with a single tile texture
|
||||
*/
|
||||
thumbnail() {
|
||||
return new PIXI.Sprite.fromImage(this.info.baseURL)
|
||||
return new PIXI.Sprite.from(this.info.baseURL)
|
||||
}
|
||||
|
||||
/** Returns a list of all tiles of a given level.
|
||||
|
||||
@@ -84,7 +84,7 @@ export class PIXITileLoader extends TileLoader {
|
||||
constructor(tiles, compression) {
|
||||
super(tiles)
|
||||
this.destroyed = false
|
||||
this.loader = new PIXI.loaders.Loader()
|
||||
this.loader = new PIXI.Loader()
|
||||
this.loader.on('load', this._onLoaded.bind(this))
|
||||
this.loader.on('error', this._onError.bind(this))
|
||||
if (compression) {
|
||||
@@ -256,7 +256,7 @@ export class RequestTileLoader extends TileLoader {
|
||||
}
|
||||
xhr.send()
|
||||
} else {
|
||||
let texture = PIXI.Texture.fromImage('assets/image.png')
|
||||
let texture = PIXI.Texture.from('assets/image.png')
|
||||
this._textureAvailable(url, col, row, texture)
|
||||
if (callback) callback()
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export default class Tile extends PIXI.Sprite {
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a tile from image using the PIXI.Texture.fromImage method.
|
||||
* Loads a tile from image using the PIXI.Texture.from method.
|
||||
*
|
||||
* @static
|
||||
* @param {*} imageId
|
||||
@@ -62,7 +62,7 @@ export default class Tile extends PIXI.Sprite {
|
||||
* @memberof Tile
|
||||
*/
|
||||
static fromImage(imageId, crossorigin, scaleMode) {
|
||||
return new Tile(PIXI.Texture.fromImage(imageId, crossorigin, scaleMode), imageId)
|
||||
return new Tile(PIXI.Texture.from(imageId, crossorigin, scaleMode), imageId)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user