foundryvtt-reve-de-dragon/module/tmr/carte-tmr.js

32 lines
930 B
JavaScript
Raw Normal View History

2023-11-10 03:39:35 +01:00
import { TMRUtility } from "../tmr-utility.js";
import { Draconique } from "./draconique.js";
2023-05-29 08:38:22 +02:00
import { PixiTMR } from "./pixi-tmr.js";
export class CarteTmr extends Draconique {
type() { return '' }
match(item) { return false; }
manualMessage() { return false }
async onActorCreateOwned(actor, item) { }
code() { return 'tmr' }
2023-10-20 22:18:37 +02:00
img() { return 'systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr.webp' }
createSprite(pixiTMR) {
2023-10-20 22:18:37 +02:00
const img = PixiTMR.getImgFromCode(this.code())
const sprite = new PIXI.Sprite(PIXI.utils.TextureCache[img]);
// Setup the position of the TMR
2023-11-15 22:14:00 +01:00
sprite.x = pixiTMR.pixiApp.screen.x;
sprite.y = pixiTMR.pixiApp.screen.y;
sprite.width = pixiTMR.pixiApp.screen.width;
sprite.height = pixiTMR.pixiApp.screen.height;
2023-10-20 22:18:37 +02:00
// Rotate around the center
sprite.anchor.set(0);
sprite.buttonMode = true;
sprite.tmrObject = pixiTMR;
return sprite;
}
2023-10-20 22:18:37 +02:00
2023-11-10 03:39:35 +01:00
}