forked from public/foundryvtt-reve-de-dragon
v10/v11 compat
This commit is contained in:
@ -102,6 +102,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
createPixiSprites() {
|
||||
console.log("Create sprite")
|
||||
EffetsDraconiques.carteTmr.createSprite(this.pixiTMR);
|
||||
this.updateTokens();
|
||||
this.forceDemiRevePositionView();
|
||||
|
@ -3,6 +3,7 @@ import { Draconique } from "./draconique.js";
|
||||
export class CarteTmr extends Draconique {
|
||||
|
||||
constructor() {
|
||||
console.log("Sprite create 1!!!!")
|
||||
super();
|
||||
}
|
||||
|
||||
@ -15,6 +16,7 @@ export class CarteTmr extends Draconique {
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/styles/img/ui/tmp_main_r1.webp' }
|
||||
|
||||
createSprite(pixiTMR) {
|
||||
console.log("Sprite create!!!!")
|
||||
return pixiTMR.carteTmr(this.code());
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user