Updated to PixiJS v5.

This commit is contained in:
2019-09-10 16:34:59 +02:00
parent a775126f9c
commit ebe0b1253f
29 changed files with 46482 additions and 67844 deletions
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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.
+2 -2
View File
@@ -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()
}
+2 -2
View File
@@ -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)
}
/**