Skip to content

Commit 5f17f59

Browse files
committed
configure etc.
1 parent 6bbafa2 commit 5f17f59

19 files changed

Lines changed: 478 additions & 102 deletions

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.hintrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": [
3+
"development"
4+
],
5+
"hints": {
6+
"meta-viewport": "off"
7+
}
8+
}

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"useArrowFunction": "off"
1515
},
1616
"suspicious": {
17-
"noAssignInExpressions": "off"
17+
"noAssignInExpressions": "off",
18+
"noPrototypeBuiltins": "off"
1819
}
1920
}
2021
}

demo/.eslintrc.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

demo/demo-big.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="initial-scale=1">
7+
<style>
8+
html,
9+
body {
10+
height: 100%;
11+
}
12+
13+
body {
14+
margin: 0;
15+
padding: 0;
16+
font: caption;
17+
}
18+
19+
canvas {
20+
display: block;
21+
}
22+
</style>
23+
<title>Demo of Phaser 3 Debug Game Scale Plugin</title>
24+
</head>
25+
26+
<body>
27+
<script defer src="../node_modules/phaser/dist/phaser.js"></script>
28+
<script defer src="../dist/phaser-plugin-debug-game-scale.umd.js"></script>
29+
<script defer src="./demo-big.js"></script>
30+
</body>
31+
32+
</html>

demo/demo-big.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
const scene = {
2+
init: function () {
3+
const cat = [
4+
'....443...443.',
5+
'...4433..4433.',
6+
'..44333.48333.',
7+
'88888888244444',
8+
'44444444433333',
9+
'44444444433333',
10+
'44044404433333',
11+
'44488844433333',
12+
'44400044433333',
13+
'44F202F4433333',
14+
'44202024433333',
15+
'44F222F4433333',
16+
'44444444433333',
17+
'4433...4433.33',
18+
'4433...4433.33'
19+
];
20+
21+
this.textures.generate('cat', { data: cat, pixelWidth: 10 });
22+
},
23+
24+
create: function () {
25+
const { centerX, centerY, width, height } = this.cameras.default;
26+
27+
this.add.image(centerX, centerY, 'cat');
28+
this.add.image(0, 0, 'cat').setOrigin(0, 0);
29+
this.add.image(width, height, 'cat').setOrigin(1, 1);
30+
31+
this.input.on('pointerup', function () {
32+
this.scale.startFullscreen();
33+
}, this);
34+
}
35+
};
36+
37+
new Phaser.Game({
38+
type: Phaser.CANVAS,
39+
backgroundColor: 0x555555,
40+
plugins: {
41+
global: [
42+
{ key: 'PhaserDebugGameScalePlugin', plugin: PhaserDebugGameScalePlugin, start: true, data: { font: '24px system-ui', lineHeight: 32, width: 960, height: 480 } }
43+
]
44+
},
45+
scale: {
46+
width: 1920, height: 1080,
47+
mode: Phaser.Scale.FIT,
48+
min: { width: 640, height: 360 },
49+
max: { width: 1920, height: 1080 },
50+
autoCenter: Phaser.Scale.CENTER_BOTH
51+
},
52+
scene: scene
53+
});

demo/demo-envelop.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="initial-scale=1">
7+
<style>
8+
html,
9+
body {
10+
height: 100%;
11+
}
12+
13+
body {
14+
margin: 0;
15+
padding: 0;
16+
font: caption;
17+
}
18+
19+
canvas {
20+
display: block;
21+
}
22+
</style>
23+
<title>Demo of Phaser 3 Debug Game Scale Plugin</title>
24+
</head>
25+
26+
<body>
27+
<script defer src="../node_modules/phaser/dist/phaser.js"></script>
28+
<script defer src="../dist/phaser-plugin-debug-game-scale.umd.js"></script>
29+
<script defer src="./demo-envelop.js"></script>
30+
</body>
31+
32+
</html>

demo/demo-envelop.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const scene = {
2+
preload: function () {
3+
this.load.image('bg', 'bg.png');
4+
},
5+
6+
create: function () {
7+
this.add.image(0, 0, 'bg').setOrigin(0, 0);
8+
}
9+
};
10+
11+
new Phaser.Game({
12+
type: Phaser.CANVAS,
13+
backgroundColor: 0x555555,
14+
plugins: {
15+
global: [
16+
{ key: 'PhaserDebugGameScalePlugin', plugin: PhaserDebugGameScalePlugin, start: true }
17+
]
18+
},
19+
scale: {
20+
width: 800, height: 600,
21+
mode: Phaser.Scale.ENVELOP,
22+
autoCenter: Phaser.Scale.CENTER_BOTH
23+
},
24+
scene: scene
25+
});

demo/demo-resize.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="initial-scale=1">
7+
<style>
8+
html,
9+
body {
10+
height: 100%;
11+
}
12+
13+
body {
14+
margin: 0;
15+
padding: 0;
16+
font: caption;
17+
}
18+
19+
canvas {
20+
display: block;
21+
}
22+
</style>
23+
<title>Demo of Phaser 3 Debug Game Scale Plugin</title>
24+
</head>
25+
26+
<body>
27+
<script defer src="../node_modules/phaser/dist/phaser.js"></script>
28+
<script defer src="../dist/phaser-plugin-debug-game-scale.umd.js"></script>
29+
<script defer src="./demo-resize.js"></script>
30+
</body>
31+
32+
</html>

0 commit comments

Comments
 (0)