Skip to content

Commit 13e3588

Browse files
authored
Create docs/TileEditor.md
1 parent decb909 commit 13e3588

File tree

1 file changed

+236
-0
lines changed

1 file changed

+236
-0
lines changed

docs/TileEditor.md

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
# GM - TileEditor
2+
3+
## Starting the editor
4+
5+
You can start the editor by running `GMTEEditor new`.
6+
7+
> By running `GMTEEditor register` you can add the editor to the Apps menu.
8+
9+
## Menu functions
10+
11+
### Import
12+
13+
#### Importing a tile set
14+
15+
After providing a tile height in pixels you can select a tile set file that is automatically cut into tiles and loaded into the tile store.
16+
17+
#### Importing a tilemap
18+
19+
Import a previously exported tile map to keep working on it.
20+
21+
### Export
22+
23+
#### Export as tilemap
24+
25+
Export your current progress on the tilemap to a file.
26+
27+
> Can be reimported to continue working on it.
28+
29+
#### Export as PNG
30+
31+
Save the tilemap as a picture.
32+
33+
### Open in world
34+
35+
Opens the current tilemap morph to experiment with its current state.
36+
37+
### Toggle grid
38+
39+
Toggles the visibility of the map grid.
40+
41+
### Toggle Background
42+
43+
Toggles the dynamic filling of the tile maps background with the background tile.
44+
45+
> The background tile can be selected by right clicking a tile in the tile store.
46+
47+
### Reset View
48+
49+
Reset your view after zooming in/out or moving your view.
50+
51+
## Tile Store
52+
Select a tile by left clicking it.
53+
54+
Select a background tile by right clicking it.
55+
56+
## Tilemap
57+
58+
Place tiles on the current layer by left clicking.
59+
Remove tiles on the current layer by right clicking.
60+
61+
> You can place / remove multiple tiles by holding left / right click and dragging your mouse over the desired tiles.
62+
> You can rotate your currently selected tile by pressing <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>r</kbd> Zoom in/out by scrolling.
63+
64+
Hold shift, left click and drag your mouse to move your view.
65+
66+
## Toolbar
67+
68+
### Undo/Redo
69+
70+
Un-/Redo your last action, whether that is a layer action, a drawing/erasing action or resizing the tilemap.
71+
72+
### Brushes
73+
74+
You can choose from a selection from brushes.
75+
Additionally you can choose a radius which applies to the (default) brush and the line tool.
76+
77+
#### (default) Brush
78+
79+
Places tiles where you click and, depending on the radius, around it.
80+
81+
#### Line Tool
82+
83+
Click and drag to draw a line between start and end point.
84+
A larger radius leads to a thicker line.
85+
86+
#### Fill tool
87+
88+
Click on a tile to replace all alike connected tiles with a new tile.
89+
90+
#### Rectangle Tool
91+
92+
Place a rectangle of tiles by clicking in the upper left corner and dragging to the lower right corner of the desired rectangle. When you release the mouse button the area is filled with your selected tile.
93+
94+
## Inspector Tab
95+
96+
Allows you to adjust the tilemaps attributes.
97+
98+
### Grid height / width
99+
100+
Adjusts the height / width of the tilemap.
101+
102+
### Padding
103+
104+
The distance between the grid and the edge of the tilemap.
105+
106+
## Layer Tab
107+
108+
### Selecting layers
109+
110+
Select and deselect layers to manipulate them.
111+
112+
> You can select multiple layers by shift + clicking.
113+
> Some layer actions only work if just one layer is selected.
114+
115+
### Layer Actions
116+
117+
#### Add Layer
118+
119+
Adds a new layer in front of the other layers.
120+
121+
#### Move up / down
122+
123+
Moves the currently selected layer up / down by one.
124+
125+
#### Renaming
126+
127+
Allows you to choose a custom name for the currently selected layer.
128+
129+
#### Clearing
130+
131+
Clears all currently selected layers.
132+
133+
#### Blending
134+
135+
Blends all currently selected layers into one.
136+
137+
#### Deleting
138+
139+
Deletes all currently selected layers.
140+
141+
#### Toggling visibility
142+
143+
Shows / hides all currently selected layers.
144+
145+
## Keyboard Shortcuts
146+
147+
There are keyboard shortcuts for quick access to the editor functions.
148+
149+
### Menu Functions
150+
151+
| Function | Shortcut |
152+
| ----------------- | ------------ |
153+
| Import Tilemap | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>i</kbd> |
154+
| Import Tileset | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>o</kbd> |
155+
| Export Tilemap | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>s</kbd> |
156+
| Toggle Grid | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>g</kbd> |
157+
| Toggle Background | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>h</kbd> |
158+
159+
### Layer Functions
160+
161+
| Function | Shortcut |
162+
| ------------------------------------ | ------------ |
163+
| Add Layer | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>a</kbd> |
164+
| Rename Layer | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>n</kbd> |
165+
| Clear selected Layers | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>c</kbd> |
166+
| Blend selected Layers | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>b</kbd> |
167+
| Delete selected Layers | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>x</kbd> |
168+
| Toggle visibility of selected Layers | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>v</kbd> |
169+
170+
### Tools
171+
172+
| Function | Shortcut |
173+
| ---------------------- | ------------ |
174+
| Undo | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>z</kbd> |
175+
| Redo | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>y</kbd> |
176+
| Rotate selected Tile | <kbd>ctrl</kbd>/<kbd>alt</kbd> + <kbd>r</kbd> |
177+
| Select (default) brush | <kbd>alt</kbd> + <kbd>1</kbd> |
178+
| Select Line Tool | <kbd>alt</kbd> + <kbd>2</kbd> |
179+
| Select Fill Tool | <kbd>alt</kbd> + <kbd>3</kbd> |
180+
| Select Rectangle Tool | <kbd>alt</kbd> + <kbd>4</kbd> |
181+
182+
## Dev API
183+
184+
The tilemap offers an API for developement.
185+
186+
### `toFullcreen`
187+
188+
Automatically rescales your tilemap to fill out the screen.
189+
190+
### `mapGridOnly`
191+
192+
Reduces the tileMap to the grid and removes the dynamic background frame.
193+
194+
### `toggleVisualLayer`
195+
196+
Toggles the visibility of the grid.
197+
198+
### `showVisualLayer` / `hideVisualLayer`
199+
200+
Shows / hides the grid.
201+
202+
### `toForeground`
203+
204+
Ensures that the tilemap morph is drawn in front oft the squeak UI.
205+
206+
### `toFullScreenMode`
207+
208+
Enables fullscreen mode.
209+
210+
### `toggleBackgroundLayer`
211+
212+
Toggles the dynamic filling of the maps background with the background tile.
213+
214+
### `deleteTiles: anIndexSet inLayer: aLayer`
215+
216+
Delete the tiles specified by the indices in anIndexSet in the specified layer.
217+
218+
### `placeTiles: anIndexSet inLayer: aLayer ofClass: aTileClass withImage: anImage`
219+
220+
Place tiles specified by the indices in anIndexSet in the specified layer with a provided image. The argument aTileClass allows to add custom tiles, which inherit from GMTETile.
221+
222+
### `placeTiles: anIndexSet inLayer: aLayer withImage: anImage`
223+
224+
Place GMTETiles specified by the indices in anIndexSet in the specified layer with a provided image.
225+
226+
## Using your tilemap for your game
227+
228+
The TileEditor offers class-side methods (GMTEEditor) which load your tilemap from a local file path / the Git Asset Browser without starting the TileEditor so you can use it in your game.
229+
230+
### `GMTEEditor getTileMapFromFilePath:` your local filepath
231+
232+
Used to import a tilemap directly from a file. Returns a tilemap from a given local filepath, which should point to a .morph file previously exported from the TileEditor.
233+
234+
### `GMTEEditor getTileMapFromProjectName:` name of your project in Git Browser `withPath:` your filepath in Git Asset Browser
235+
236+
Used to import a tilemap from the Git Asset Browser in Squeak. Returns a tilemap from the projectname and a relative filepath in the Asset Browser, which should point to a .morph file previously exported from the TileEditor.

0 commit comments

Comments
 (0)