All Projects → pixijs → Tilemap

pixijs / Tilemap

Licence: mit
Rectangular tilemap implementation for PixiJS

Projects that are alternatives of or similar to Tilemap

Hilo3d
Hilo3d, a WebGL Rendering Engine.
Stars: ✭ 123 (-30.51%)
Mutual labels:  webgl, canvas
R3f Next Starter
Repo is moving to https://github.com/pmndrs/react-three-next
Stars: ✭ 137 (-22.6%)
Mutual labels:  webgl, canvas
Gcanvas
A lightweight cross-platform graphics rendering engine. (超轻量的跨平台图形引擎) https://alibaba.github.io/GCanvas
Stars: ✭ 1,705 (+863.28%)
Mutual labels:  webgl, canvas
Skqw
JavaScript Audio Visualizer
Stars: ✭ 112 (-36.72%)
Mutual labels:  webgl, canvas
Zen 3d
JavaScript 3D library.
Stars: ✭ 155 (-12.43%)
Mutual labels:  webgl, canvas
Knowledge
文档着重构建一个完整的「前端技术架构图谱」,方便 F2E(Front End Engineering又称FEE、F2E) 学习与进阶。
Stars: ✭ 1,620 (+815.25%)
Mutual labels:  webgl, canvas
Phaser Examples
Contains hundreds of source code examples and related media for the Phaser HTML5 Game Framework.
Stars: ✭ 1,680 (+849.15%)
Mutual labels:  webgl, canvas
React Ape
🦍• [Work in Progress] React Renderer to build UI interfaces using canvas/WebGL
Stars: ✭ 1,183 (+568.36%)
Mutual labels:  webgl, canvas
Proton
Javascript particle animation library
Stars: ✭ 1,958 (+1006.21%)
Mutual labels:  webgl, canvas
Wechart
Create all the [ch]arts by cax or three.js - Cax 和 three.js 创造一切图[表]
Stars: ✭ 152 (-14.12%)
Mutual labels:  webgl, canvas
Fe Daily Record
📚前端书籍汇集点 + 每日好文推荐 + 公开课学习资料 + 各种大会资料
Stars: ✭ 94 (-46.89%)
Mutual labels:  webgl, canvas
Mesh.js
A graphics system born for visualization 😘.
Stars: ✭ 156 (-11.86%)
Mutual labels:  webgl, canvas
React Tint
A React component that applies image processing filters to an image using Processing
Stars: ✭ 89 (-49.72%)
Mutual labels:  webgl, canvas
Freeciv Web
Freeciv-web is an Open Source strategy game implemented in HTML5 and WebGL, which can be played online against other players, or in single player mode against AI opponents.
Stars: ✭ 1,626 (+818.64%)
Mutual labels:  webgl, canvas
Phaser Ce
Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
Stars: ✭ 1,186 (+570.06%)
Mutual labels:  webgl, canvas
Earthjs
D3 Earth JS
Stars: ✭ 128 (-27.68%)
Mutual labels:  webgl, canvas
Glslcanvas
Simple tool to load GLSL shaders on HTML Canvas using WebGL
Stars: ✭ 1,067 (+502.82%)
Mutual labels:  webgl, canvas
Deep Viz
A React component library, providing concise and beautiful diversity charts with Canvas, SVG, E-map, WebGL, Dom, based on data visualization experience and commercial data display practice.
Stars: ✭ 55 (-68.93%)
Mutual labels:  webgl, canvas
Alien.js
Future web pattern
Stars: ✭ 141 (-20.34%)
Mutual labels:  webgl, canvas
Layaair discard
This is old LayaAir veriosn writetten by ActionScript 3.0 ,now LayaAir is using TypeScript as the Engine Script,Please use https://github.com/layabox/LayaAir instead.
Stars: ✭ 1,858 (+949.72%)
Mutual labels:  webgl, canvas

@pixi/tilemap - PixiJS Tilemap Kit

Node.js CI

This package provides a low-level rectangular tilemap implementation, optimized for high performance rendering and a out-of-the-box canvas fallback. It's designed to work with PixiJS 6. We've migrated from pixi-tilemap to @pixi/tilemap on npm!

Installation 📦

# pixi-tilemap for older versions
npm i --save @pixi/tilemap

You can also use the UMD flavor:

<script src="dist/pixi-tilemap.umd.js"></script>

Usage

In short, the tilemap you create will render each tile texture at the provided position and dimensions. Generally, a spritesheet is used to load the tileset assets:

import { Loader } from '@pixi/loaders';
import { CompositeTilemap } from '@pixi/tilemap';

Loader.shared.add('atlas.json');
Loader.shared.onLoad(function onTilesetLoaded()
{
    const tilemap = new CompositeTilemap();

    // Render your first tile at (0, 0)!
    tilemap.add('grass.png', 0, 0);
});

CompositeTilemap is actually a lazy composite of layered Tilemap instances. A Tilemap has a fixed number of tile textures (the tileset) it can render in one go. Usually, CompositeTilemap abstracts away this limitation in a robust enough manner.

Basic demo 🖊

webgl

Settings 📄

import { settings } from '@pixi/tilemap';

TEXTURES_PER_TILEMAP

This is the limit on how many base-textures can be used in a tilemap. Using more than this limit will fail silently. CompositeTilemap gets around this by issuing new tilemaps whenever the tilemaps reach full capacity. This is 16 by default.

settings.TEXTURES_PER_TILEMAP = 8;

Here, for example, the 9th tile texture will be rendered using a fresh tilemap. You can specify a bigger value if you want everything to be on the same z-index.

TEXTILE_UNITS

@pixi/tilemap also provides a texture packing optimization - it will upload multiple tile base-textures by laying them in a 2-column format inside a larger base-texture. By default, this is disabled and TEXTILE_UNITS is set 1. The recommended value is 4, if the feature is desired.

This is old RpgMakerMV-compatible setting:

settings.TEXTILE_UNITS = 4;
settings.TEXTURES_PER_TILEMAP = 4;

use32bitIndex

There's also a limitation on 16k tiles per one tilemap. If you want to lift it, please use pixi v5.1.0 and following setting:

settings.use32bitIndex = true;

RPGMaker

For RPGMaker MV please use v4 branch for pixi V4, npm version is 1.2.6

Please use v3 branch for pixi V3.

Canvas fallback is 5x slower than vanilla rpgmaker. Webgl version is faster and doesnt use extra textures.

RPGMaker demo

webgl: zoomin and zoomout

retina webgl: zoomin and zoomout

canvas

More tutorials 🔗

Alan01252 tutorial

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].