DOM Element game resize at the same time and the same size at the canvas of phaser
Remove VisitCard scss unused
This commit is contained in:
parent
61180a6e64
commit
6868128267
3 changed files with 8 additions and 13 deletions
|
@ -18,17 +18,6 @@
|
||||||
margin-top: 200px;
|
margin-top: 200px;
|
||||||
max-width: 100vw;
|
max-width: 100vw;
|
||||||
|
|
||||||
.defaultCard {
|
|
||||||
border-radius: 5px;
|
|
||||||
border: 2px black solid;
|
|
||||||
background-color: whitesmoke;
|
|
||||||
width: 530px;
|
|
||||||
|
|
||||||
header {
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
iframe {
|
iframe {
|
||||||
border: 0;
|
border: 0;
|
||||||
width: 530px;
|
width: 530px;
|
||||||
|
|
|
@ -39,6 +39,14 @@ class WaScaleManager {
|
||||||
const style = this.scaleManager.canvas.style;
|
const style = this.scaleManager.canvas.style;
|
||||||
style.width = Math.ceil(realSize.width / devicePixelRatio) + 'px';
|
style.width = Math.ceil(realSize.width / devicePixelRatio) + 'px';
|
||||||
style.height = Math.ceil(realSize.height / devicePixelRatio) + 'px';
|
style.height = Math.ceil(realSize.height / devicePixelRatio) + 'px';
|
||||||
|
|
||||||
|
// Resize the game element at the same size at the canvas
|
||||||
|
const gameStyle = document.getElementById('game')?.style;
|
||||||
|
if (gameStyle != undefined) {
|
||||||
|
gameStyle.height = style.height;
|
||||||
|
gameStyle.width = style.width;
|
||||||
|
}
|
||||||
|
|
||||||
// Note: onResize will be called twice (once here and once is Game.ts), but we have no better way.
|
// Note: onResize will be called twice (once here and once is Game.ts), but we have no better way.
|
||||||
for (const scene of this.game.scene.getScenes(true)) {
|
for (const scene of this.game.scene.getScenes(true)) {
|
||||||
if (scene instanceof ResizableScene) {
|
if (scene instanceof ResizableScene) {
|
||||||
|
|
|
@ -367,8 +367,6 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
#game {
|
#game {
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
position: relative; /* Position relative is needed for the game-overlay. */
|
position: relative; /* Position relative is needed for the game-overlay. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue