Skip to content

Commit ef2a7d9

Browse files
Help: update offline Phaser Editor help to 1.2.1
1 parent b40dcd2 commit ef2a7d9

17 files changed

+192
-97
lines changed

source/phasereditor/phasereditor.help/html/quick-start/Scene Editor - Phaser Editor Blog.html

Lines changed: 54 additions & 18 deletions
Large diffs are not rendered by default.

source/phasereditor/phasereditor.help/html/quick-start/Texture Atlas editor - Phaser Editor Blog.htm

Lines changed: 28 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -6,134 +6,88 @@
66

77
<body>
88

9+
910
<h2 class="title" itemprop="headline"><a href="http://phasereditor.boniatillo.com/blog/quick-start/050-texture-atlas">Texture Atlas editor</a></h2>
1011
<div class="desc text-left" itemprop="articleBody">
1112
<p>Texture atlas is an important resource that developers have to improve the performance of their games.</p>
1213

1314
<p><a href="https://www.youtube.com/watch?v=3YQ-sFIUZxE&amp;index=6&amp;list=PLB8gI_5U0MvCJuhPv-LBdi_a9PQxYxFqK">Watch a demo video</a></p>
1415

15-
<p>In Phaser Editor we give full support to texture atlas, we provide
16-
the Atlas Editor to do the job. There are other external tools that you
17-
can use but we think that integrating a texture packer in Phaser Editor
18-
is part of our philosophy of deliver a complete and integrated
19-
development environment.</p>
16+
<p>In Phaser Editor we give full support to texture atlas, we provide the Atlas Editor to do the job. There are other external tools that you can use but we think that integrating a texture packer in Phaser Editor is part of our philosophy of deliver a complete and integrated development environment.</p>
2017

2118
<p>Our Atlas Editor uses the <a href="https://github.com/libgdx/libgdx/tree/master/extensions/gdx-tools">LibGDX Texture Packer</a>, it features the MaxRect algorithm and can be tuned to satisfy the requirements of the majority of the games.</p>
2219

2320
<h2>Create the atlas</h2>
2421

2522
<p>To create an atlas click on <code>File &gt; New &gt; Atlas Generator File</code>, it opens a dialog to set the name of the atlas and the container folder. This container folder should be a sub-folder of <code>assets</code> folder.</p>
2623

27-
<p><img src="Texture%20Atlas%20editor%20-%20Phaser%20Editor%20Blog_files/20151021181700-NewAtlasWizard.png" alt="enter image description here"></p>
24+
<p><img src="./Texture Atlas editor - Phaser Editor Blog_files/20151021181700-NewAtlasWizard.png" alt="enter image description here"></p>
2825

29-
<p>When you press <code>Finish</code>, a file <code>myatlas.atlas</code>
30-
is created and the Atlas Editor is open to edit it. This file does not
31-
contains any relation with Phaser, else it contains Phaser Editor
32-
related stuff, like the atlas settings and the path of the source
33-
images. So you should exclude it from a game build, but keep it on your
34-
game development source.</p>
26+
<p>When you press <code>Finish</code>, a file <code>myatlas.atlas</code> is created and the Atlas Editor is open to edit it. This file does not contains any relation with Phaser, else it contains Phaser Editor related stuff, like the atlas settings and the path of the source images. So you should exclude it from a game build, but keep it on your game development source.</p>
3527

3628
<p>One time the atlas file is created and the Atlas Editor is open to edit it then you can start adding images to the atlas.</p>
3729

3830
<p>To add the image files to the atlas follow these steps:</p>
3931

4032
<ol>
4133
<li>Select the image files in the Project Explorer.</li>
42-
<li>Drag the files and drop them into the atlas editor. You can also
43-
drop complete folders, in that case it adds the image files in depth.</li>
34+
<li>Drag the files and drop them into the atlas editor. You can also drop complete folders, in that case it adds the image files in depth.</li>
4435
<li>Save the atlas file (<code>CTRL+S</code> or <code>File &gt; Save</code>). It generates the Phaser atlas JSON file (with the JSON Hash format) and the texture image (PNG) file.</li>
4536
</ol>
4637

47-
<p><img src="Texture%20Atlas%20editor%20-%20Phaser%20Editor%20Blog_files/20151022043135-AtlasEditor_AddFiles.png" alt="Atlas Editor: add files"></p>
38+
<p><img src="./Texture Atlas editor - Phaser Editor Blog_files/20151022043135-AtlasEditor_AddFiles.png" alt="Atlas Editor: add files"></p>
4839

49-
<p>The last step is very important, remember <code>myatlas.atlas</code>
50-
file is a specific Phaser Editor file, it is a configuration file used
51-
to generate the real JSON atlas and PNG texture file. So when you save
52-
the editor's content a <code>myatlas.json</code> and <code>myatlas.png</code> files are generated. These are the files you should load in your game. Also note the source images are not placed under the <code>assets</code> folder else under the <code>Design</code> folder. Phaser Editor creates the <code>Design</code>
53-
folder and encourages the developer to put there the files are not
54-
included in the game but are used to generate the game assets, like is
55-
the case of the atlas source images.</p>
40+
<p>The last step is very important, remember <code>myatlas.atlas</code> file is a specific Phaser Editor file, it is a configuration file used to generate the real JSON atlas and PNG texture file. So when you save the editor's content a <code>myatlas.json</code> and <code>myatlas.png</code> files are generated. These are the files you should load in your game. Also note the source images are not placed under the <code>assets</code> folder else under the <code>Design</code> folder. Phaser Editor creates the <code>Design</code> folder and encourages the developer to put there the files are not included in the game but are used to generate the game assets, like is the case of the atlas source images.</p>
5641

5742
<p>To load the atlas in your game you can use the <code>Phaser.Loader.atlasJSONHash()</code> method or load the <a href="http://phasereditor.boniatillo.com/blog/quick-start/020-asset-pack">Asset Pack</a> file.</p>
5843

59-
<p><img src="Texture%20Atlas%20editor%20-%20Phaser%20Editor%20Blog_files/20151022051745-AtlasEditor_GenerateFiles.png" alt="Atlas Editor: save and generate files."></p>
44+
<p><img src="./Texture Atlas editor - Phaser Editor Blog_files/20151022051745-AtlasEditor_GenerateFiles.png" alt="Atlas Editor: save and generate files."></p>
6045

6146
<h2>Tuning the atlas parameters</h2>
6247

63-
<p>Atlas textures can be used in different objects of your game like
64-
sprites, tile sprites, sprite-sheets, etc.. Often you should adjust the
65-
parameters of the packer to get a texture applicable to the different
66-
functions.</p>
48+
<p>Atlas textures can be used in different objects of your game like sprites, tile sprites, sprite-sheets, etc.. Often you should adjust the parameters of the packer to get a texture applicable to the different functions.</p>
6749

6850
<p>To change these parameter click the "wrench icon" in the editor toolbar. It opens the Settings dialog:</p>
6951

70-
<p><img src="Texture%20Atlas%20editor%20-%20Phaser%20Editor%20Blog_files/20151022053313-AtlasEditor_Settings.png" alt="Atlas Editor: settings"></p>
52+
<p><img src="./Texture Atlas editor - Phaser Editor Blog_files/20151022053313-AtlasEditor_Settings.png" alt="Atlas Editor: settings"></p>
7153

7254
<p>The settings are:</p>
7355

74-
<ol>
75-
<li><strong>Min/Max Size</strong>: to change the size of the texture
76-
image. There are cases where the editor generates more than one Phaser
77-
(JSON) atlas files. It is because the texture has no space for all
78-
images so it creates another atlas to put there the remaining images.
79-
However you can change the max size of the texture to make space for all
80-
the sprites.</li>
81-
<li><strong>Size constraints</strong>: you can select <code>Any Size</code> (default) or <code>POT (Power of 2)</code>.
82-
In the second case the editor generates a texture with a size power of
83-
2. In some platforms this kind of textures performs better.</li>
84-
<li><strong>Padding</strong>: it controls the spacing between the
85-
sprites. It is useful to remove artifacts from sprites animations, tile
86-
sprites, in general when the source images has color pixels in the
87-
borders. By default it puts 2.</li>
88-
<li><strong>Strip white spaces</strong>: to remove the extra space of
89-
sprites. If your source images have extra space (transparent areas)
90-
around the picture, then activating these parameters the editor
91-
generates a texture that removes that spaces and a JSON file that
92-
specify to Phaser to render the sprites with the right spacing. By
93-
default these parameters are on.</li>
94-
</ol>
56+
<ul>
57+
<li><strong>Min/Max Size</strong>: to change the size of the texture image. There are cases where the editor generates more than one Phaser (JSON) atlas files. It is because the texture has no space for all images so it creates another atlas to put there the remaining images. However you can change the max size of the texture to make space for all the sprites.</li>
58+
<li><strong>Size constraints</strong>: you can select <code>Any Size</code> (default) or <code>POT (Power of 2)</code>. In the second case the editor generates a texture with a size power of 2. In some platforms this kind of textures performs better.</li>
59+
<li><strong>Padding</strong>: it controls the spacing between the sprites. It is useful to remove artifacts from sprites animations, tile sprites, in general when the source images has color pixels in the borders. By default it puts 2.</li>
60+
<li><strong>Strip white spaces</strong>: to remove the extra space of sprites. If your source images have extra space (transparent areas) around the picture, then activating these parameters the editor generates a texture that removes that spaces and a JSON file that specify to Phaser to render the sprites with the right spacing. By default these parameters are on.</li>
61+
<li><strong>Use indexes</strong>: to sort the sprites by using a <code>_01.png</code> sufix in the source files.</li>
62+
<li><strong>Alias</strong>: equal images are packed once.</li>
63+
<li><strong>Grid</strong>: to pack the images in a uniform grid. You can use this together with the Indexes option to create spritesheets.</li>
64+
</ul>
9565

9666
<h2>Multiple pages</h2>
9767

98-
<p>As we mentioned before, it is possible that one texture has no enough
99-
space for all the sprites, then many "pages" or textures are generated
100-
to place the remaining sprites.</p>
68+
<p>As we mentioned before, it is possible that one texture has no enough space for all the sprites, then many "pages" or textures are generated to place the remaining sprites.</p>
10169

102-
<p>When this happens the editor creates multiple tabs to show all the
103-
textures and generates the Phaser atlas files with a number suffix. For
104-
example, if the packer generates two textures we get the files <code>myatlas1.json</code>, <code>myatlas1.png</code>, <code>myatlas2.json</code> and <code>myatlas2.png</code>:</p>
70+
<p>When this happens the editor creates multiple tabs to show all the textures and generates the Phaser atlas files with a number suffix. For example, if the packer generates two textures we get the files <code>myatlas1.json</code>, <code>myatlas1.png</code>, <code>myatlas2.json</code> and <code>myatlas2.png</code>:</p>
10571

106-
<p><img src="Texture%20Atlas%20editor%20-%20Phaser%20Editor%20Blog_files/20151022062952-AtlasEditor_MultiplePages.png" alt="Atlas Editor: multiple pages"></p>
72+
<p><img src="./Texture Atlas editor - Phaser Editor Blog_files/20151022062952-AtlasEditor_MultiplePages.png" alt="Atlas Editor: multiple pages"></p>
10773

10874
<h2>The side panel</h2>
10975

110-
<p>Close to the wrench tool icon there is the "side panel" icon. By
111-
default the side panel is hidden but you can show it selecting that
112-
icon.</p>
76+
<p>Close to the wrench tool icon there is the "side panel" icon. By default the side panel is hidden but you can show it selecting that icon.</p>
11377

11478
<p>This panel shows the name of the sprites and a small window with the sprites and pages information.</p>
11579

116-
<p>When you click on a sprite in the right panel (canvas), that sprite
117-
is selected in the side panel, and when you select a sprite in the side
118-
panel, it is highlighted in the texture canvas.</p>
80+
<p>When you click on a sprite in the right panel (canvas), that sprite is selected in the side panel, and when you select a sprite in the side panel, it is highlighted in the texture canvas.</p>
11981

120-
<p>You can delete some sprites by selecting it and pressing the <code>DEL</code>
121-
key or clicking on the delete icon that is placed in the editor's
122-
toolbar. Remember each time you change the atlas you should save it to
123-
generate the Phaser files.</p>
82+
<p>You can delete some sprites by selecting it and pressing the <code>DEL</code> key or clicking on the delete icon that is placed in the editor's toolbar. Remember each time you change the atlas you should save it to generate the Phaser files.</p>
12483

125-
<p><img src="Texture%20Atlas%20editor%20-%20Phaser%20Editor%20Blog_files/20151022084036-AtlasEditor_SidePanel.png" alt="Atlas Editor: side panel"></p>
84+
<p><img src="./Texture Atlas editor - Phaser Editor Blog_files/20151022084036-AtlasEditor_SidePanel.png" alt="Atlas Editor: side panel"></p>
12685

12786
<h2>Update the atlas with external changes</h2>
12887

129-
<p>In the editor's toolbar you can see a "gear" icon, click it to
130-
re-build the atlas. When you change the source image files then you
131-
should rebuild the atlas to regenerate the texture, do this by pressing
132-
that "gear" icon.</p>
88+
<p>In the editor's toolbar you can see a "gear" icon, click it to re-build the atlas. When you change the source image files then you should rebuild the atlas to regenerate the texture, do this by pressing that "gear" icon.</p>
13389

134-
<p>When you rebuild the atlas the editor shows a dialog to confirm that
135-
you want to save the atlas, if you accept, then the atlas is saved and
136-
the Phaser atlas files are generated.</p>
90+
<p>When you rebuild the atlas the editor shows a dialog to confirm that you want to save the atlas, if you accept, then the atlas is saved and the Phaser atlas files are generated.</p>
13791
</div><!--//desc-->
13892

13993
</body>

0 commit comments

Comments
 (0)