Skip to content

Commit bd54ce5

Browse files
author
Arian Fornaris
committed
Upload new docs website sources.
1 parent 9363d2d commit bd54ce5

File tree

112 files changed

+2190
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+2190
-0
lines changed

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = python -msphinx
7+
SPHINXPROJ = PhaserEditor
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
95.7 KB
Binary file not shown.

docs/_static/pygments.css

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
.wy-table-responsive table td, .wy-table-responsive table th {
2+
white-space: normal;
3+
}
4+
5+
6+
div[class^='highlight'] pre {
7+
font-size: 14px !important;
8+
font-family: courier;
9+
word-wrap: break-word;
10+
white-space: pre-wrap;
11+
}
12+
13+
.highlight .hll { background-color: #ffffcc }
14+
.highlight { background: #f8f8f8; font-size: 16px !important; }
15+
.highlight .c { color: #8f5902; font-style: italic } /* Comment */
16+
.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */
17+
.highlight .g { color: #000000 } /* Generic */
18+
.highlight .k { color: #204a87; font-weight: bold;} /* Keyword */
19+
.highlight .l { color: #000000 } /* Literal */
20+
.highlight .n { color: #000000 } /* Name */
21+
.highlight .o { color: #ce5c00; font-weight: bold } /* Operator */
22+
.highlight .x { color: #000000 } /* Other */
23+
.highlight .p { color: #000000; font-weight: bold } /* Punctuation */
24+
.highlight .ch { color: #8f5902; font-style: italic } /* Comment.Hashbang */
25+
.highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */
26+
.highlight .cp { color: #8f5902; font-style: italic } /* Comment.Preproc */
27+
.highlight .cpf { color: #8f5902; font-style: italic } /* Comment.PreprocFile */
28+
.highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */
29+
.highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */
30+
.highlight .gd { color: #a40000 } /* Generic.Deleted */
31+
.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */
32+
.highlight .gr { color: #ef2929 } /* Generic.Error */
33+
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
34+
.highlight .gi { color: #00A000 } /* Generic.Inserted */
35+
.highlight .go { color: #000000; font-style: italic } /* Generic.Output */
36+
.highlight .gp { color: #8f5902 } /* Generic.Prompt */
37+
.highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */
38+
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
39+
.highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */
40+
.highlight .kc { color: #204a87; font-weight: bold } /* Keyword.Constant */
41+
.highlight .kd { color: #204a87; font-weight: bold } /* Keyword.Declaration */
42+
.highlight .kn { color: #204a87; font-weight: bold } /* Keyword.Namespace */
43+
.highlight .kp { color: #204a87; font-weight: bold } /* Keyword.Pseudo */
44+
.highlight .kr { color: #204a87; font-weight: bold } /* Keyword.Reserved */
45+
.highlight .kt { color: #204a87; font-weight: bold } /* Keyword.Type */
46+
.highlight .ld { color: #000000 } /* Literal.Date */
47+
.highlight .m { color: #0000cf; font-weight: bold } /* Literal.Number */
48+
.highlight .s { color: #4e9a06 } /* Literal.String */
49+
.highlight .na { color: #c4a000 } /* Name.Attribute */
50+
.highlight .nb { color: #204a87 } /* Name.Builtin */
51+
.highlight .nc { color: #000000 } /* Name.Class */
52+
.highlight .no { color: #000000 } /* Name.Constant */
53+
.highlight .nd { color: #5c35cc; font-weight: bold } /* Name.Decorator */
54+
.highlight .ni { color: #ce5c00 } /* Name.Entity */
55+
.highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */
56+
.highlight .nf { color: #000000 } /* Name.Function */
57+
.highlight .nl { color: #f57900 } /* Name.Label */
58+
.highlight .nn { color: #000000 } /* Name.Namespace */
59+
.highlight .nx { color: #000000 } /* Name.Other */
60+
.highlight .py { color: #000000 } /* Name.Property */
61+
.highlight .nt { color: #204a87; font-weight: bold } /* Name.Tag */
62+
.highlight .nv { color: #000000 } /* Name.Variable */
63+
.highlight .ow { color: #204a87; font-weight: bold } /* Operator.Word */
64+
.highlight .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */
65+
.highlight .mb { color: #0000cf; font-weight: bold } /* Literal.Number.Bin */
66+
.highlight .mf { color: #0000cf; font-weight: bold } /* Literal.Number.Float */
67+
.highlight .mh { color: #0000cf; font-weight: bold } /* Literal.Number.Hex */
68+
.highlight .mi { color: #0000cf; font-weight: bold } /* Literal.Number.Integer */
69+
.highlight .mo { color: #0000cf; font-weight: bold } /* Literal.Number.Oct */
70+
.highlight .sa { color: #4e9a06 } /* Literal.String.Affix */
71+
.highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */
72+
.highlight .sc { color: #4e9a06 } /* Literal.String.Char */
73+
.highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */
74+
.highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */
75+
.highlight .s2 { color: #4e9a06 } /* Literal.String.Double */
76+
.highlight .se { color: #4e9a06 } /* Literal.String.Escape */
77+
.highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */
78+
.highlight .si { color: #4e9a06 } /* Literal.String.Interpol */
79+
.highlight .sx { color: #4e9a06 } /* Literal.String.Other */
80+
.highlight .sr { color: #4e9a06 } /* Literal.String.Regex */
81+
.highlight .s1 { color: #4e9a06 } /* Literal.String.Single */
82+
.highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */
83+
.highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */
84+
.highlight .fm { color: #000000 } /* Name.Function.Magic */
85+
.highlight .vc { color: #000000 } /* Name.Variable.Class */
86+
.highlight .vg { color: #000000 } /* Name.Variable.Global */
87+
.highlight .vi { color: #000000 } /* Name.Variable.Instance */
88+
.highlight .vm { color: #000000 } /* Name.Variable.Magic */
89+
.highlight .il { color: #0000cf; font-weight: bold } /* Literal.Number.Integer.Long */

docs/assets_manager.rst

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
Assets Management
2+
=================
3+
4+
In Phaser Editor we encourage to use the `Asset Pack JSON Format <http://www.html5gamedevs.com/topic/6807-new-phaser-asset-pack-feature-please-test>`_ to load the assets of your games, it allow a better organization and comprehension of the assets and we provide many features around this file, specially the scene maker.
5+
6+
7+
`Watch a demo video <https://www.youtube.com/watch?v=mMopa8gTpoQ&index=2&list=PLB8gI_5U0MvCJuhPv-LBdi_a9PQxYxFqK>`_
8+
9+
The asset pack
10+
--------------
11+
12+
In the Phaser repository there is the file ``resources/Asset Pack JSON Format/assetPack.json``. It is an example of how the assets can be loaded via the asset pack. We reproduce here the Phaser's authors explanation of that file:
13+
14+
An Asset Pack is a means to control the loading of assets into Phaser via a JSON file. Use ``Phaser.Loader.pack()`` to load your data file.
15+
16+
The file is split into sections (...) Sections are a way for you to control the splitting-up of asset loading, so you don't have to load everything at once.
17+
18+
The key you use for the sections is entirely up to you and is passed to the ``Phaser.Loader.pack`` call.
19+
20+
Within each section is an Array of objects. Each object corresponds to a single file to be loaded. The "type" property controls the type of file. Note that lots of the file properties are optional. See the ``Phaser.Loader`` API Documentation to find out which ones, as they match the API calls exactly.
21+
22+
Where a file type has a callback, such as "script", the context in which the callback is run should be passed to the ``Phaser.Loader.pack`` method. See the examples for further details.
23+
24+
Create the pack file
25+
--------------------------
26+
27+
If you create a project based on the built-in Phaser Editor templates then this file is created automatically. You can find it in the ``WebContent/assets/assets-pack.json`` path.
28+
29+
To create the pack file manually, go to ``File > New > Asset Pack File``:
30+
31+
.. image:: images/NewAssetPackMenu.png
32+
:alt: Asset pack file menu
33+
34+
It opens the Asset Pack File wizard. In this wizard you should write the name of the file and select the folder where to create the pack. By default, it selects the ``assets`` folder, but you can select any folder in any project. Press Finish to create the file and it opens in the Asset Pack editor.
35+
36+
.. image:: images/NewAssetPackSelectFolder.png
37+
:alt: Asset pack wizard
38+
39+
The pack file editor
40+
--------------------
41+
42+
The Asset Pack file is a JSON file that you can edit manually, but in Phaser Editor this file can be modified using a dedicated editor with a graphical interface.
43+
44+
The editor has two panels: the assets tree and the asset details.
45+
46+
In the assets tree you add, remove and rename the sections and the entries. The asset details panel shows the properties of the object selected in the tree.
47+
48+
To modify an asset entry, you select it in the tree and change the values in the details panel.
49+
50+
The details panel also shows the JSDoc of the different parameters, it is the same doc of the parameters of the loader method.
51+
52+
For example, if you select an "image" object in the tree, the details panel shows the parameters of the ``Phaser.Loader.image()`` method. You can modify the values of the parameters and you can see the documentation of it (hover the mouse in the parameter's name).
53+
54+
.. image:: images/AssetPackEditor.png
55+
:alt: Asset pack editor
56+
57+
58+
Load the assets from the pack file
59+
----------------------------------
60+
61+
In Phaser the asstes are loaded in the preload method of the game state. The code to load them looks like this:
62+
63+
.. code-block:: javascript
64+
65+
game.load.image("dino", "path/to/dino.png");
66+
game.load.image("montain", "path/to/montain.png");
67+
game.load.spritesheet("girl", "path/to/mujer-trotando.png", 64, 64);
68+
game.load.audio("music", "path/to/guajira.ogg");
69+
...
70+
71+
For each asset to load you have to write a loader's method call.
72+
73+
When you use an asset pack you only have to write a line to load a section from the asset pack:
74+
75+
.. code-block:: javascript
76+
77+
game.load.pack("level", "path/to/assets-pack.json");
78+
79+
It automatically loads all the assets defined in the ``"level"`` section of the pack ``assets-pack.json``.
80+
81+
Assets explorer
82+
---------------
83+
84+
The Assets explorer is a key tool in Phaser Editor. It allows the user to navigate, preview, use and refactor the assets in a friendly way.
85+
86+
Navigate the assets
87+
~~~~~~~~~~~~~~~~~~~
88+
89+
The Assets view show the hierarchy of the assets declared on the packs of the active project. The assets, as in the pack editor, are grouped in pack files and sections, but in addition you can get access to the frames of spritesheets or texture atlases. For example, a texture atlas is a node that you can expand to see all the sprites of the texture.
90+
91+
Since ``Phaser Editor v1.4``, the visual scenes and prefabs (Canvas files) are also available in the Assets view, in addition to the assets declared in the pack files.
92+
93+
.. image:: images/AssetsView.png
94+
:alt: Assets explorer
95+
96+
To open the Assets view type ``Ctrl+3`` and write ``assets``. It shows you a list of elements related to the word ``assets``, just click the one that says ``Assets View``.
97+
98+
Quick preview of the assets
99+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
100+
101+
Many of the items in the Assets window can be quickly previewed: audio entries, videos, images, textures and Canvas (visual editor) files. Just hover the mouse on top of the element and a quick popup will show you the preview. Or drag the item and drop it in the `Preview <./preview_window.html>`_ window.
102+
103+
The icons and preview images of the assets are computed in a background process that is tiggered each time the assets change. Check the `Troubleshooting`_ section below, there is explained how to fix some glitches related to assets.
104+
105+
Add objects to a Canvas scene
106+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107+
108+
In addition to the assets of the pack files, the Assets window show the visual scenes and prefabs (Canvas files). These files can be dragged from the Assets window and dropped into an open visual editor to create new objects.
109+
110+
Assets references search
111+
~~~~~~~~~~~~~~~~~~~~~~~~
112+
113+
To search all the references -in the whole project- of an asset could be a very desired feature in certain cases. In the Assets window you can rigth-click on an asset and select to search all the references.
114+
115+
.. image:: images/FindAssetsMenu.png
116+
:alt: Find asset references
117+
118+
For now only Canvas scenes have references to the assets, so a search for references will show a list of objects in the scenes that are using the selected asset.
119+
120+
The result of a search is shown in the Search window, and you can double click on any of the element to locate them in the visual scene editor.
121+
122+
.. image:: images/SearchAssetResults.png
123+
:alt: Asset search result.
124+
125+
126+
Assets refactoring
127+
~~~~~~~~~~~~~~~~~~
128+
129+
A nice new feature in Phaser Editor is the refactoring tools. These tools allow the user to change asset names, delete asset entries or replace asset textures by executing safe operations that can be undone.
130+
131+
Delete an asset
132+
^^^^^^^^^^^^^^^
133+
134+
To delete an asset entry right-click on it and select the ``Refactoring > Delete`` option. Please remember that an asset entry is just a definition, an entry, in the asset pack file. By deleting an asset entry you only are modifing the ``pack.json`` file, the real file, like an image, is not touched.
135+
136+
.. image:: images/DeleteAssetMenu.png
137+
:alt: Delete asset menu
138+
139+
140+
*Note that some elements shown in the Assets view cannot be deleted. For example you cannot delete a frame of a texture atlas, you only can delete a complete texture atlas.*
141+
142+
After select the option to delete an asset, it opens a confirmation dialog with the option of preview the list of files that will be affected by the deletion.
143+
144+
.. image:: images/PreviewAffectedFiles.png
145+
:alt: Preview the affected files
146+
147+
148+
Rename asset
149+
^^^^^^^^^^^^
150+
151+
The process of rename an asset is pretty similar to the process of delete it. A confirmation dialog is opened and the user can preview the affected files. The main difference is that if the user confirms the operation, then all the Canvas files will be updated to use the new name.
152+
153+
Move asset
154+
^^^^^^^^^^
155+
156+
Assets can be moved from one section to other. Just follow the same process of the rename, in the context menu select the ``Refactoring > Move`` option. It shows a dialog to select the new section for the asset and the option to preview the affected files. This operation can be undone and updates all the affected files so it does not introduce errors.
157+
158+
159+
Global replace texture
160+
^^^^^^^^^^^^^^^^^^^^^^
161+
162+
This is a very useful operation and consists on replace certain texture (represented by an asset in the pack file) in all the objects of all the scenes of the project. These are the steps:
163+
164+
* Select the texture you want to replace. For example a demo texture that you want to replace for the final terxture.
165+
.. image:: images/AssetReplaceMenu.png
166+
:alt: Asset replace menu
167+
* Select the texture replacement and confirm.
168+
.. image:: images/SelectNewTextureReplacement.png
169+
:alt: Select the new texture
170+
171+
All the objects that used ``flor`` as texture will be modified to use the texture ``zombi-head``.
172+
173+
174+
Troubleshooting
175+
---------------
176+
177+
If you find that your assets are in an invalid state or you see a strange behavior then to fix it you can try by cleaning the projects.
178+
179+
Internally Phaser Editor uses a memory model with all the assets and its properties. This memory model should be synchronized with the physical and real data, but it happens that sometime because external changes or maybe bugs, the memory model is not in synchronization with the physical one. In this case, the best is to force the editor to create the memory model from scratch.
180+
181+
To do this select in the main menu the option ``Project > Clean...``, it opens a dialog with the list of your projects. Select those you want to re-build and press the **OK** button. After this operation all the visual editors and views should be updated to show the new fresh/fixed data.
182+
183+
184+
.. image:: images/CleanProjects.png
185+
:alt: Clean projects.
186+
187+
If the strange behavior continues please `open an issue <https://github.com/boniatillo-com/PhaserEditor/issues>`_.

docs/audio_sprites.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Audio Sprites Editor
2+
====================
3+
4+
Audio Sprites are generally a 'hang over' from pre-Web Audio days, where they were literally the only way to have multiple sound effects / music in a game. However they're still pretty useful even for web audio playback, as it means less http requests and mostly retains compatibility with older devices that still don't support Web Audio, or browsers like IE that don't at all either. -- `Richard Davey <http://www.html5gamedevs.com/topic/6582-advantages-audio-sprites/#entry39190>`_ .
5+
6+
Audio Sprites are a combination of audio files and a JSON configuration. The JSON follows the format of that created by `tonistiigi <https://github.com/tonistiigi/audiosprite>`_. In Phaser Editor we provide an editor to easy create and edit audio sprites.
7+
8+
To create an audio sprites go to the File menu and select ``New > Audio Sprites File`` and it opens a dialog to select the container folder and set the file name.
9+
10+
.. image:: images/AudioSpriteWizard.png
11+
:alt: New audio sprites wizard.
12+
13+
When you press finish it creates a JSON file with the sprites definitions. This file is opened in the Audio Sprite Editor, then you can drag some audio files from the Project Explorer and drop them into the editor. When you drop the audio files into the editor they are appended to a single audio file. Remember that audio sprites contains a "big" audio file formed by the concatenation of the different sounds spaced by a little time of silence.
14+
15+
For example, if your audio sprites JSON is ``sounds.json``, then when you add audio files to the editor, these audio files are appended to a ``sounds.wav`` file new sprites entries are created with default values.
16+
17+
This resultant ``sounds.wav`` file is transcoded to MP3 and OGG formats, so at the end you get two other ``sounds.mp3`` and ``sounds.ogg`` files.
18+
19+
All the audio manipulation is done using the `FFMpeg <https://www.ffmpeg.org/>`_ tool.
20+
21+
.. image:: images/AudioSpritesEditor.png
22+
:alt: Create and edit the audio sprites.
23+
24+
As you can see in the above image, the editor has two panels, the top panel show the audio waves and the range of the sprites. When you move the mouse over this panel a vertical line indicates the time at the cursor's position.
25+
26+
In the bottom panel are listed the sprites. You can edit, add or remove the sprites. To edit it select the row of the sprite and click cell with the value you want to change.
27+
28+
If you drag new audio files, new sprites are created and get the name and range from the audio files.
29+
30+
It is possible that some audio files cannot be concatenated with a good result, audio files have a diversity of sources but we process them with the same ffmpeg configuration. In any case, if you have troubles concatenating the files, you can do it with a tool like Audacity and then edit the sprites info with Phaser Editor.

docs/autobuild.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
sphinx-autobuild -b html . _build/html/
4+

0 commit comments

Comments
 (0)