forked from public/foundryvtt-reve-de-dragon
Nouvelles TMRs
This commit is contained in:
@ -4,7 +4,6 @@ import { PixiTMR } from "./pixi-tmr.js";
|
||||
export class CarteTmr extends Draconique {
|
||||
|
||||
constructor() {
|
||||
console.log("Sprite create 1!!!!")
|
||||
super();
|
||||
}
|
||||
|
||||
@ -14,9 +13,25 @@ export class CarteTmr extends Draconique {
|
||||
async onActorCreateOwned(actor, item) { }
|
||||
|
||||
code() { return 'tmr' }
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/styles/img/ui/tmp_main_r1.webp' }
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr.webp' }
|
||||
|
||||
createSprite(pixiTMR) {
|
||||
return pixiTMR.carteTmr(this.code());
|
||||
|
||||
const img = PixiTMR.getImgFromCode(this.code())
|
||||
const sprite = new PIXI.Sprite(PIXI.utils.TextureCache[img]);
|
||||
// Setup the position of the TMR
|
||||
sprite.x = 0;
|
||||
sprite.y = 0;
|
||||
sprite.width = 722;
|
||||
sprite.height = 860;
|
||||
// Rotate around the center
|
||||
sprite.anchor.set(0);
|
||||
sprite.buttonMode = true;
|
||||
sprite.tmrObject = pixiTMR;
|
||||
|
||||
pixiTMR.addTooltip(sprite, (e,s) => this.computeTooltip(e,s));
|
||||
pixiTMR.pixiApp.stage.addChild(sprite);
|
||||
return sprite;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user