How to create tilemap in phaser ? #4
Answered
by
regisrex
pacifiquem
asked this question in
Q&A
-
Describe better way of creating tilemap in Phaser and provided all used resources to answer the question . |
Beta Was this translation helpful? Give feedback.
Answered by
regisrex
Jan 25, 2023
Replies: 1 comment
-
A better way and mostly used way to create tilemaps in pixijs is to import Tilemap class from @pixi/tilemap package, and then simple create an instance of the class import { Tilemap } from '@pixi/tilemap';
(() => {
const tilemap = new Tilemap([Texture.from('grass.png').baseTexture])
.tile('grass.png', 0, 0)
.tile('grass.png', 100, 100)
.tile('brick_wall.png', 0, 100);
}()) The code above creates a Tilemap instance and shades it with a texture from the image |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
pacifiquem
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A better way and mostly used way to create tilemaps in pixijs is to import Tilemap class from @pixi/tilemap package, and then simple create an instance of the class
The code above creates a Tilemap instance and shades it with a texture from the image
grass.png
.