Skip to content

Commit 5f06aca

Browse files
Project: update Phaser Project templates.
1 parent 81c99be commit 5f06aca

File tree

32 files changed

+466
-333
lines changed

32 files changed

+466
-333
lines changed

source/phasereditor/phasereditor.resources.templates/templates_newproject/JavaScript/MultipleStates/WebContent/assets/canvas/Boot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Boot.prototype.preload = function () {
3232

3333
Boot.prototype.create = function () {
3434

35-
// all the assets used in the splash are loaded
36-
// so jump to the Preloader state
35+
// all the assets used in the splash are loaded
36+
// so jump to the Preloader state
3737
this.game.state.start("Preloader");
3838

3939

source/phasereditor/phasereditor.resources.templates/templates_newproject/JavaScript/MultipleStates/WebContent/assets/canvas/Level.canvas

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"canvas-version": 2,
33
"settings": {
44
"className": "Level",
5-
"sceneWidth": 640,
6-
"sceneHeight": 360,
5+
"sceneWidth": 800,
6+
"sceneHeight": 600,
77
"generateOnSave": true,
88
"enableStepping": false,
99
"lang": "JAVA_SCRIPT",
@@ -18,8 +18,7 @@
1818
200,
1919
200
2020
],
21-
"showGrid": true,
22-
"create_after": "this.initObjects();"
21+
"showGrid": true
2322
},
2423
"stateSettings": {
2524
"stageBackgroundColor": [
@@ -38,7 +37,16 @@
3837
"info": {
3938
"editorName": "Level",
4039
"setAll": [],
41-
"children": []
40+
"children": [{
41+
"type": "text",
42+
"id": "4cce57bf-d864-4f25-a56f-126886599739",
43+
"info": {
44+
"editorName": "playingText",
45+
"x": 299.8662109375,
46+
"y": 290.2373352050781,
47+
"text": "You are playing now!"
48+
}
49+
}]
4250
}
4351
},
4452
"type": "STATE",

source/phasereditor/phasereditor.resources.templates/templates_newproject/JavaScript/MultipleStates/WebContent/assets/canvas/Level.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/* --- start generated code --- */
55

6-
// Generated by Phaser Editor 1.4.3 (Phaser v2.6.2)
6+
// Generated by 1.4.3 (Phaser v2.6.2)
77

88

99
/**
@@ -31,12 +31,11 @@ Level.prototype.preload = function () {
3131
};
3232

3333
Level.prototype.create = function () {
34-
this.initObjects();
34+
this.add.text(300, 290, 'You are playing now!', {"font":"bold 20px Arial"});
35+
36+
3537

3638
};
3739

3840
/* --- end generated code --- */
39-
40-
Level.prototype.initObjects = function() {
41-
this.add.text(100, 100, "You are playing now!");
42-
};
41+
// -- user code here --

source/phasereditor/phasereditor.resources.templates/templates_newproject/JavaScript/MultipleStates/WebContent/assets/canvas/Menu.canvas

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"canvas-version": 2,
33
"settings": {
44
"className": "Menu",
5-
"sceneWidth": 640,
6-
"sceneHeight": 360,
5+
"sceneWidth": 800,
6+
"sceneHeight": 600,
77
"generateOnSave": true,
88
"enableStepping": false,
99
"lang": "JAVA_SCRIPT",
@@ -18,8 +18,7 @@
1818
200,
1919
200
2020
],
21-
"showGrid": true,
22-
"create_after": "// user code\r\nthis.initObjects();"
21+
"showGrid": true
2322
},
2423
"stateSettings": {
2524
"stageBackgroundColor": [
@@ -38,7 +37,16 @@
3837
"info": {
3938
"editorName": "Menu",
4039
"setAll": [],
41-
"children": []
40+
"children": [{
41+
"type": "text",
42+
"id": "33877423-5c83-4194-9d6b-f3009b6c5cee",
43+
"info": {
44+
"editorName": "text",
45+
"x": 331.755859375,
46+
"y": 292.09765625,
47+
"text": "Click to start..."
48+
}
49+
}]
4250
}
4351
},
4452
"type": "STATE",

source/phasereditor/phasereditor.resources.templates/templates_newproject/JavaScript/MultipleStates/WebContent/assets/canvas/Menu.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/* --- start generated code --- */
55

6-
// Generated by Phaser Editor 1.4.3 (Phaser v2.6.2)
6+
// Generated by 1.4.3 (Phaser v2.6.2)
77

88

99
/**
@@ -31,16 +31,14 @@ Menu.prototype.preload = function () {
3131
};
3232

3333
Menu.prototype.create = function () {
34-
// user code
35-
this.initObjects();
34+
this.add.text(332, 292, 'Click to start...', {"font":"bold 20px Arial"});
35+
36+
3637

3738
};
3839

3940
/* --- end generated code --- */
4041

41-
Menu.prototype.initObjects = function() {
42-
this.add.text(100, 100, "Click to play");
43-
};
4442

4543
Menu.prototype.update = function () {
4644
if (this.input.activePointer.isDown) {

source/phasereditor/phasereditor.resources.templates/templates_newproject/JavaScript/MultipleStates/WebContent/assets/canvas/Preloader.canvas

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"canvas-version": 2,
33
"settings": {
44
"className": "Preloader",
5-
"sceneWidth": 640,
6-
"sceneHeight": 360,
5+
"sceneWidth": 800,
6+
"sceneHeight": 600,
77
"generateOnSave": true,
88
"enableStepping": false,
99
"lang": "JAVA_SCRIPT",
@@ -19,8 +19,7 @@
1919
200
2020
],
2121
"showGrid": true,
22-
"create_before": "// all the assets are loaded, go to the menu screen\r\nthis.game.state.start(\"Menu\");",
23-
"state_preload_after": "this.add.text(300, 300, \"Loading...\", { fill:\"#fff\" });"
22+
"create_before": "// all the assets are loaded, go to the menu screen\r\nthis.game.state.start(\"Menu\");"
2423
},
2524
"stateSettings": {
2625
"scaleMode": "SHOW_ALL",
@@ -46,7 +45,17 @@
4645
"info": {
4746
"editorName": "Preload",
4847
"setAll": [],
49-
"children": []
48+
"children": [{
49+
"type": "text",
50+
"id": "6c7ec22b-e55c-49b2-84f7-1486fd4f4e7b",
51+
"info": {
52+
"editorName": "loadingText",
53+
"x": 353.73828125,
54+
"y": 290.2373046875,
55+
"text": "Loading...",
56+
"style.fill": "#ffffff"
57+
}
58+
}]
5059
}
5160
},
5261
"type": "STATE",

source/phasereditor/phasereditor.resources.templates/templates_newproject/JavaScript/MultipleStates/WebContent/assets/canvas/Preloader.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/* --- start generated code --- */
55

6-
// Generated by Phaser Editor 1.4.3 (Phaser v2.6.2)
6+
// Generated by 1.4.3 (Phaser v2.6.2)
77

88

99
/**
@@ -32,13 +32,16 @@ Preloader.prototype.preload = function () {
3232

3333
this.load.pack('preloader', 'assets/pack.json');
3434

35-
this.add.text(300, 300, "Loading...", { fill:"#fff" });
35+
36+
this.add.text(354, 290, 'Loading...', {"font":"bold 20px Arial","fill":"#ffffff"});
37+
38+
3639

3740
};
3841

3942
Preloader.prototype.create = function () {
4043

41-
// all the assets are loaded, go to the menu screen
44+
// all the assets are loaded, go to the menu screen
4245
this.game.state.start("Menu");
4346

4447

source/phasereditor/phasereditor.resources.templates/templates_newproject/JavaScript/SingleState/WebContent/assets/canvas/Level.canvas

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"canvas-version": 2,
33
"settings": {
44
"className": "Level",
5-
"sceneWidth": 640,
6-
"sceneHeight": 360,
5+
"sceneWidth": 800,
6+
"sceneHeight": 600,
77
"generateOnSave": true,
88
"enableStepping": false,
99
"lang": "JAVA_SCRIPT",
@@ -19,7 +19,7 @@
1919
200
2020
],
2121
"showGrid": true,
22-
"create_after": "// to change this code: Canvas editor > Configuration > Editor > userCode > Create\r\nthis.addHelloWorldText();\r\n\r\n"
22+
"create_after": "\r\n\r\n"
2323
},
2424
"stateSettings": {
2525
"scaleMode": "SHOW_ALL",
@@ -30,6 +30,7 @@
3030
255,
3131
255
3232
],
33+
"autoLoad": true,
3334
"preloadSpriteId": "",
3435
"preloadSprite_direction": 0,
3536
"load.pack": []
@@ -39,7 +40,17 @@
3940
"id": "8a0fc0bc-e3be-4656-9585-f855ac8ba0bb",
4041
"info": {
4142
"editorName": "Level",
42-
"children": []
43+
"setAll": [],
44+
"children": [{
45+
"type": "text",
46+
"id": "1caab328-1560-4093-9221-f7313302024f",
47+
"info": {
48+
"editorName": "hellowText",
49+
"x": 343.9580078125,
50+
"y": 292.2246398925781,
51+
"text": "Hello world!"
52+
}
53+
}]
4354
}
4455
},
4556
"type": "STATE",
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
1+
2+
// -- user code here --
3+
4+
/* --- start generated code --- */
5+
6+
// Generated by 1.4.3 (Phaser v2.6.2)
7+
8+
19
/**
210
* Level.
311
*/
412
function Level() {
5-
13+
614
Phaser.State.call(this);
7-
15+
816
}
917

1018
/** @type Phaser.State */
1119
var Level_proto = Object.create(Phaser.State.prototype);
1220
Level.prototype = Level_proto;
1321
Level.prototype.constructor = Level;
1422

15-
Level.prototype.init = function() {
16-
23+
Level.prototype.init = function () {
24+
1725
this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
1826
this.scale.pageAlignHorizontally = true;
1927
this.scale.pageAlignVertically = true;
2028
this.stage.backgroundColor = '#ffffff';
21-
29+
2230
};
2331

24-
Level.prototype.preload = function() {
25-
32+
Level.prototype.preload = function () {
33+
2634
};
2735

28-
Level.prototype.create = function() {
29-
// to change this code: Canvas editor > Configuration > Editor > userCode > Create
30-
this.addHelloWorldText();
31-
36+
Level.prototype.create = function () {
37+
this.add.text(344, 292, 'Hello world!', {"font":"bold 20px Arial"});
38+
39+
40+
3241
};
3342

3443
/* --- end generated code --- */
35-
36-
Level.prototype.addHelloWorldText = function() {
37-
this.add.text(100, 100, "hello world!");
38-
};
44+
// -- user code here --

source/phasereditor/phasereditor.resources.templates/templates_newproject/JavaScript_6/MultipleStates/WebContent/assets/canvas/Boot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class Boot extends Phaser.State {
2929

3030
create() {
3131

32-
// all the assets used in the splash are loaded
33-
// so jump to the Preloader state
32+
// all the assets used in the splash are loaded
33+
// so jump to the Preloader state
3434
this.game.state.start("Preloader");
3535

3636

0 commit comments

Comments
 (0)