Fix livre

This commit is contained in:
2020-07-05 22:35:18 +02:00
parent ea94e27e5a
commit 7d9f6fd6c3
7 changed files with 35 additions and 11 deletions

View File

@ -24,10 +24,10 @@ export class RdDTMRDialog extends Dialog {
let dialogOptions = { classes: [ "tmrdialog"] }
dialogConf.title = "Terres Médianes de Rêve",
dialogOptions.width = 600;
dialogOptions.height = 360;
dialogOptions.width = 740;
dialogOptions.height = 960;
super(dialogConf, dialogOptions);
this.sort = sort;
this.actor = actor;
}
@ -38,8 +38,22 @@ export class RdDTMRDialog extends Dialog {
}
/* -------------------------------------------- */
loadImage(url) {
return new Promise(r => { let i = new Image(); i.onload = (() => r(i)); i.src = url; });
}
/* -------------------------------------------- */
async init_canvas() {
var ctx = document.getElementById('canvas_tmr');
ctx = ctx.getContext('2d');
let img = await this.loadImage("systems/foundryvtt-reve-de-dragon/styles/ui/tmp_main_r1.webp");
await ctx.drawImage(img, 0, 0, 720, 860);
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
this.init_canvas();
}
}