Merge branch 'develop' of github.com:thecodingmachine/workadventure into trigger-message-refv3
This commit is contained in:
commit
4713010929
90 changed files with 2336 additions and 10674 deletions
|
@ -163,3 +163,17 @@ WA.room.setTiles([
|
|||
{x: 9, y: 4, tile: 'blue', layer: 'setTiles'}
|
||||
]);
|
||||
```
|
||||
|
||||
### Loading a tileset
|
||||
```
|
||||
WA.room.loadTileset(url: string): Promise<number>
|
||||
```
|
||||
Load a tileset in JSON format from an url and return the id of the first tile of the loaded tileset.
|
||||
|
||||
You can create a tileset file in Tile Editor.
|
||||
|
||||
```javascript
|
||||
WA.room.loadTileset("Assets/Tileset.json").then((firstId) => {
|
||||
WA.room.setTiles([{x: 4, y: 4, tile: firstId, layer: 'bottom'}]);
|
||||
})
|
||||
```
|
35
docs/maps/text.md
Normal file
35
docs/maps/text.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
{.section-title.accent.text-primary}
|
||||
# Writing text on a map
|
||||
|
||||
## Solution 1: design a specific tileset (recommended)
|
||||
|
||||
If you want to write some text on a map, our recommendation is to create a tileset that contains
|
||||
your text. You will obtain the most pleasant graphical result with this result, since you will be able
|
||||
to control the fonts you use, and you will be able to disable the antialiasing of the font to get a
|
||||
"crispy" result easily.
|
||||
|
||||
## Solution 2: using a "text" object in Tiled
|
||||
|
||||
On "object" layers, Tiled has support for "Text" objects. You can use these objects to add some
|
||||
text on your map.
|
||||
|
||||
WorkAdventure will do its best to display the text properly. However, you need to know that:
|
||||
|
||||
- Tiled displays your system fonts.
|
||||
- Computers have different sets of fonts. Therefore, browsers never rely on system fonts
|
||||
- Which means if you select a font in Tiled, it is quite unlikely it will render properly in WorkAdventure
|
||||
|
||||
To circumvent this problem, in your text object in Tiled, you can add an additional property: `font-family`.
|
||||
|
||||
The `font-family` property can contain any "web-font" that can be loaded by your browser.
|
||||
|
||||
{.alert.alert-info}
|
||||
**Pro-tip:** By default, WorkAdventure uses the **'"Press Start 2P"'** font, which is a great pixelated
|
||||
font that has support for a variety of accents. It renders great when used at *8px* size.
|
||||
|
||||
<div>
|
||||
<figure class="figure">
|
||||
<img src="https://workadventu.re/img/docs/text-object.png" class="figure-img img-fluid rounded" alt="" style="width: 70%" />
|
||||
<figcaption class="figure-caption">The "font-family" property</figcaption>
|
||||
</figure>
|
||||
</div>
|
|
@ -56,7 +56,7 @@ A few things to notice:
|
|||
|
||||
## Building walls and "collidable" areas
|
||||
|
||||
By default, the characters can traverse any tiles. If you want to prevent your characeter from going through a tile (like a wall or a desktop), you must make this tile "collidable". You can do this by settings the `collides` property on a given tile.
|
||||
By default, the characters can traverse any tiles. If you want to prevent your character from going through a tile (like a wall or a desktop), you must make this tile "collidable". You can do this by settings the `collides` property on a given tile.
|
||||
|
||||
To make a tile "collidable", you should:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue