v10/v11 compat

This commit is contained in:
2023-05-25 20:40:59 +02:00
parent e2a9f55740
commit 75a0f7c322
195 changed files with 497 additions and 6 deletions

View File

@ -20,18 +20,24 @@ export class PixiTMR {
this.callbacksOnAnimate = [];
}
load( onLoad = (loader, resources) => {} ) {
let loader = this.pixiApp.loader;
async load( onLoad = (loader, resources) => {} ) {
// WIP è- Deprecated since v7 : let loader = new PIXI.Loader();
for (const [name, img] of Object.entries(PixiTMR.textures)) {
loader = loader.add(name, img);
const texture = await PIXI.Assets.load(img);
let image = PIXI.Sprite.from(texture);
}
loader.onError.add((error, reason) => { console.log("ERROR", error, reason) });
loader.load( (loader, resources) => {
console.log(">>>>>>>>>>>>>< ALL TEXTURE LOADED")
//onLoad(loader, resources); ??
for (let onAnimate of this.callbacksOnAnimate) { //??
onAnimate();
}
//loader.onError.add((error, reason) => { console.log("ERROR", error, reason) });
/*loader.load( (loader, resources) => {
onLoad(loader, resources);
for (let onAnimate of this.callbacksOnAnimate) {
onAnimate();
}
});
});*/
}
static register(name, img) {
@ -44,7 +50,9 @@ export class PixiTMR {
}
carteTmr(code) {
console.log(code)
const carteTmr = new PIXI.Sprite(PIXI.utils.TextureCache[code]);
console.log(code, carteTmr)
// Setup the position of the TMR
carteTmr.x = 0;
carteTmr.y = 0;