Skip to content

Commit 41aef63

Browse files
Merge branch 'develop'
2 parents cecd54f + b544854 commit 41aef63

File tree

7 files changed

+71
-3
lines changed

7 files changed

+71
-3
lines changed

CHANGELOG.MD

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Change Log
22

3+
## v3.60.3 - Apr 27
4+
5+
* Get latest version.
6+
7+
## v3.60.2 - Apr 26
8+
9+
* Adds a new chapter: Scene Editor - Miscellaneous.
10+
* Adds chapter for integrating Visual Studio Code with Phaser Editor 2D.
11+
312
## v3.60.1 - Apr 21
413

514
* Get latest version.

code-editor/vscode-compatibility.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,13 @@ Code Server
2727

2828
If you are using a remote instance of |PhaserEditor|_, you can try `Code Server <https://github.com/cdr/code-server/>`_. It allows to run VS Code in the same |PhaserEditor|_ server and edit the game code in your local browser.
2929

30-
Also, you can use cloud services like GitHub Codespace or Gitpod. In both cases you can install Phaser Editor 2D Core as a project dependency and run it alongside with VS Code.
30+
Also, you can use cloud services like GitHub Codespace or Gitpod. In both cases you can install Phaser Editor 2D Core as a project dependency and run it alongside with VS Code.
31+
32+
Visual Studio Code & Phaser Editor 2D integration
33+
`````````````````````````````````````````````````
34+
35+
|PhaserEditor|_ provides a few features for providing a better integration is |vscode|_:
36+
37+
* The **Open Visual Studio Code** command ``(Ctrl+Alt+U)`` opens the project's folder in |vscode|_.
38+
* The **Open Output File in Visual Studio Code** ``(Ctrl+Alt+E)`` command is available in the context of a |SceneEditor|_, and opens the output scene's source file (JavaScript or TypeScript) in |vscode|_.
39+
* The **Enable/Disable Open Code File In External Editor** commands enable or disable the external editor (Visual Studio Code by default) as the default option for opening code files (JavaScript, TypeScript, CSS, HTML).

conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
# built documents.
5757
#
5858
# The short X.Y version.
59-
version = u'v3.60.1'
59+
version = u'v3.60.3'
6060
# The full version, including alpha/beta/rc tags.
61-
release = u'v3.60.1'
61+
release = u'v3.60.3'
6262

6363
# The language for content autogenerated by Sphinx. Refer to documentation
6464
# for a list of supported languages.

scene-editor/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Scene Editor
2323
manipulation-tools
2424
layout-tools
2525
scene-compiler
26+
misc
2627
troubleshooting
2728

2829
The |SceneEditor|_ is the most important editor of the IDE, it provides the visual tools to create scenes (or levels).

scene-editor/misc-pixel-art.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. include:: ../_header.rst
2+
3+
Enabling pixel art rendering
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5+
6+
The SceneEditor_ runs a Phaser game for rendering the scene. By default, Phaser_ renders the scene with antialiasing disabled, which is the optimal configuration for pixel-art based games. If your game is not using pixel art, then you can disable antialiasing by running the command **Disable Pixel Art Rendering**. You can enable it back with the command **Disable Pixel Art Rendering**. Once you run any of these commands, you have to reload (``Ctrl+R``) the editor.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.. include:: ../_header.rst
2+
3+
Preview active scene
4+
~~~~~~~~~~~~~~~~~~~~
5+
6+
The |SceneEditor|_ runs a Phaser scene inside it, which means, it shows you a pixel-perfect image of the scene you are creating. But sometimes you want to see the scene in action, with the physics, the inputs, the animations. For this purpose there is a trick: the **Preview Scene** (``Ctrl+0``) command.
7+
8+
This command opens your game in the default (or configured) browser but adds the `start` parameter to the URL, and sets the name of the current scene as value. If the current scene is a prefab, then it uses the last valid scene.
9+
10+
For example, if you are editing the **LevelCompleted** scene, and you run the **Preview Scene** command, the editor launches the browser and opens the URL:
11+
12+
``http://localhost:<port>/start=LevelCompleted``
13+
14+
Now, in the code of your game, you have to read the value of the `start` parameter and start the scene with the same name. This is something you have to code manually, however, the built-in Phaser Editor 2D project templates contain the code for reading the ``start`` parameter. It looks like this:
15+
16+
.. code::
17+
18+
if (process.env.NODE_ENV === "development") {
19+
20+
const start = new URLSearchParams(location.search).get("start");
21+
22+
if (start) {
23+
24+
console.log(`Development: jump to ${start}`);
25+
this.scene.start(start);
26+
return;
27+
}
28+
}
29+
30+
The ``process.env.NODE_ENV === "development"`` expression is replaced by webpack_ at compile time, by ``true`` or ``false`` in regarding you are working on a development or production build.
31+
32+
You can place that code in the **Preloader** scene or any other scene after setting up a consistent game state.
33+

scene-editor/misc.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. include:: ../_header.rst
2+
3+
Miscellaneous
4+
-------------
5+
6+
7+
.. toctree::
8+
9+
misc-preview-scene
10+
misc-pixel-art

0 commit comments

Comments
 (0)