Skip to content
Snippets Groups Projects
Commit 418a71e2 authored by Griefed's avatar Griefed :joystick:
Browse files

feat: Tile images! Instead of colours, we now display an image of what the...

feat: Tile images! Instead of colours, we now display an image of what the tiles actually look like in-game!
parent 8a1967c7
No related branches found
No related tags found
No related merge requests found
Showing
with 18 additions and 9 deletions
......@@ -73,14 +73,16 @@ with those new tiles. Edit [Tile.vue](https://github.com/Griefed/ltt-mapmaker/bl
Here's what the item for the barren-tile looks like. If you wish to add a new item, copy'n'paste this and change
- change `barren` in `@click="barren"` to the name of the new tile
- create the icon for the new tile and change `barren` in `<img src="~assets/barren.png"/>` to the name of the new tile
- create the icon for the new tile and change `barren` in `<img src="~assets/tiles/barren.webp"/>` to the name of the new tile
- images are of the `webp`-format and 55x55 pixels in size.
- images for item-selection go into `src/assets/tiles`
- change `Barren` in `<q-item-label>Barren</q-item-label>` to the name of the new tile
```vue
<q-item clickable v-close-popup @click="barren">
<q-item-section avatar>
<q-avatar>
<img src="~assets/barren.png"/>
<img src="~assets/tiles/barren.webp"/>
</q-avatar>
</q-item-section>
<q-item-section>
......@@ -96,16 +98,18 @@ After that is done, you need to add a new method for said new tile. Copy'n'paste
- change `barren` in `this.label = 'barren';` to the name of the new tile
- change `brown-6` in `this.color = 'brown-6';` to a suitable [Quasar colour](https://quasar.dev/style/color-palette#color-list) of the new tile. This is the button colour.
- change `white` in `this.textcolor = 'white';` to `black` if `this.color` of the new tile is bright, improves readability
- change `#634123` in `this.backgroundColor = 'background-color: #634123';` to a suitable colour of the new tile
- change `/barren_tile.webp` in `this.backgroundImage = 'background-image: url(/tiles/barren_tile.webp);'` to a suitable image of the new tile
- images are of the `webp`-format and usually ~50x57 pixels in size
- images for tiles to into `public/tiles`
```js
barren () {
console.log('Clicked on Barren');
this.label = 'barren';
this.color = 'brown-6';
this.textcolor = 'white';
this.backgroundColor = 'background-color: #634123';
},
console.log('Clicked on Barren');
this.label = 'barren';
this.color = 'brown-6';
this.textcolor = 'white';
this.backgroundImage = 'background-image: url(/tiles/barren_tile.webp);'
},
```
Congratulations! You've added a new tile to lttmm!
......@@ -113,3 +117,8 @@ Congratulations! You've added a new tile to lttmm!
## Expanding/changing random map names
If you wish to expand/change the random name generator, edit `const reticulating` and/or `getMapName()` in the [MainLayout.vue](https://github.com/Griefed/ltt-mapmaker/blob/c614876316d5216690c3a2dd5ae2d05974965f16/src/layouts/MainLayout.vue).
# Other things to note
Hexagon-shaped tiles would not have been possible without the help of this awesome tool available at [csshexagon on github.io](https://brenna.github.io/csshexagon/)
by the awesome [brenna](https://github.com/brenna).
public/tiles/barren_tile.webp

6.6 KiB

public/tiles/clay_tile.webp

9.28 KiB

public/tiles/desert_tile.webp

7.54 KiB

public/tiles/fish_tile.webp

8.26 KiB

public/tiles/forest_tile.webp

9.56 KiB

public/tiles/grass_tile.webp

6.76 KiB

public/tiles/ice_tile.webp

6.29 KiB

public/tiles/iron_tile.webp

8.66 KiB

public/tiles/mountain_tile.webp

9.6 KiB

public/tiles/salt_tile.webp

9.79 KiB

public/tiles/stone_tile.webp

7.41 KiB

public/tiles/water_tile.webp

7.81 KiB

public/tiles/wheat_tile.webp

9.17 KiB

public/tiles/wool_tile.webp

7.79 KiB

src/assets/barren.png

3.18 KiB

src/assets/clay.png

5.78 KiB

src/assets/desert.png

3.5 KiB

src/assets/fish.png

4.46 KiB

src/assets/grass.png

3.18 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment