gl-tiled
A WebGL renderer for maps created with the Tiled Editor.
Tested with Tiled Map Editor v1.3.3.
Contents
Usage
For the most basic usage, you only need to provide a JS object that represents the parsed JSON Tiled
map and a WebGL Context to render with.
var tilemap = new glTiled.Tilemap(mapData, { gl });
tileMap.resizeViewport(gl.canvas.width, gl.canvas.height);
var lastTime = 0;
(function draw(now)
{
requestAnimationFrame(draw);
var dt = now - lastTime;
lastTime = now;
tileMap.update(dt);
tileMap.draw();
})();
Framework Bundles
This library also ships with a number of bundles (gl-tiled.<bundle-name>.js
). These bundles contain
the code necessary for gl-tiled to integrate with other frameworks. Each bundle is listed below, with
a short description of what they do. For more information click their Documentation link.
This is the core library bundle. It is meant to work with WebGL, and therefore can work with any
framework. However, it does not provide any special code to ease integration with those frameworks.
Resource Loader (gl-tiled.resource-loader.js
) - Documentation
The Resource Loader bundle a resource-loader
middleware that makes it easy to load Tiled JSON maps.