ludic/ns-tiled.html
2026-09-17 22:10:03 +00:00

22 lines
No EOL
9.1 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tiled — Ludic</title>
<meta name="description" content="Load and draw Tiled maps.">
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="docs.css">
</head>
<body>
<header class="nav"><div class="wrap nav-in"><a class="brand" href="index.html"><span class="logo">L</span> Ludic</a><button class="nav-toggle" aria-label="Toggle menu" aria-expanded="false">☰</button><nav class="nav-links"><a href="index.html">Home</a><a href="api.html">API Reference</a><a class="nav-cta" href="https://git.workshopsoft.io/workshopsoft/ludic">Source ↗</a></nav></div></header>
<main class="wrap item">
<div class="crumbs"><a href="api.html">API Reference</a> <span>›</span> <span class="here">Tiled</span></div>
<div class="item-head"><span class="kind-badge kind-namespace">namespace</span><h1 id="top">Tiled</h1></div>
<p class="ns-blurb">Load and draw <a href="https://www.mapeditor.org/">Tiled</a> maps. Both native format families — TMX/TSX/TX (XML) and TMJ/TSJ/TJ (JSON) — read onto one intermediate, a <a href="value"><code>Value</code></a> tree in Tiled's JSON schema, with layer data decoded to a dense GID list; so a CSV <code>.tmx</code> and a base64+zlib <code>.tmj</code> of the same map read identically. <a href="tiled-read"><code>Tiled.read</code></a> returns that intermediate tree for a map file and <a href="tiled-read_tsx"><code>Tiled.read_tsx</code></a> for a tileset file. Spliced on demand when a program mentions <code>Tiled.*</code>, alongside the <a href="xml"><code>Xml</code></a>, <a href="base64"><code>Base64</code></a> and <a href="value"><code>Value</code></a> runtimes it builds on.</p>
<div class="ns-methods"><a class="ns-method" href="tiled-read.html"><code class="nm-sig">Tiled.read(path: string) -&gt; value</code><span class="nm-tip">Read a map file into the intermediate value tree.</span></a><a class="ns-method" href="tiled-read_tsx.html"><code class="nm-sig">Tiled.read_tsx(path: string) -&gt; value</code><span class="nm-tip">Read a tileset file into a value object.</span></a><a class="ns-method" href="tiled-load.html"><code class="nm-sig">Tiled.load(path: string) -&gt; map</code><span class="nm-tip">Load a map file into the runtime map model.</span></a><a class="ns-method" href="tiled-gid.html"><code class="nm-sig">Tiled.gid(map, layer: int, x: int, y: int) -&gt; int</code><span class="nm-tip">The raw GID at a cell in a tile layer.</span></a><a class="ns-method" href="tiled-resolve.html"><code class="nm-sig">Tiled.resolve(map, gid: int) -&gt; gidinfo</code><span class="nm-tip">Decode a GID into tileset, local id and flip flags.</span></a><a class="ns-method" href="tiled-width.html"><code class="nm-sig">Tiled.width(map) -&gt; int</code><span class="nm-tip">The map width in tiles.</span></a><a class="ns-method" href="tiled-height.html"><code class="nm-sig">Tiled.height(map) -&gt; int</code><span class="nm-tip">The map height in tiles.</span></a><a class="ns-method" href="tiled-layer_count.html"><code class="nm-sig">Tiled.layer_count(map) -&gt; int</code><span class="nm-tip">How many layers the map has.</span></a><a class="ns-method" href="tiled-layer_name.html"><code class="nm-sig">Tiled.layer_name(map, index: int) -&gt; string</code><span class="nm-tip">A layer's name by index.</span></a><a class="ns-method" href="tiled-draw.html"><code class="nm-sig">Tiled.draw(map, camx: int, camy: int) -&gt; void</code><span class="nm-tip">Draw every visible tile layer.</span></a><a class="ns-method" href="tiled-project.html"><code class="nm-sig">Tiled.project(map, layer: int) -&gt; void</code><span class="nm-tip">Project a collision layer to the byte tilemap.</span></a><a class="ns-method" href="tiled-tree.html"><code class="nm-sig">Tiled.tree(map) -&gt; value</code><span class="nm-tip">The underlying intermediate value tree.</span></a><a class="ns-method" href="tiled-tile_prop.html"><code class="nm-sig">Tiled.tile_prop(map, gid: int, name: string) -&gt; int</code><span class="nm-tip">Whether a GID's tile carries a bool property.</span></a><a class="ns-method" href="tiled-collide.html"><code class="nm-sig">Tiled.collide(map, layer: int) -&gt; void</code><span class="nm-tip">Drive collision from per-tile metadata.</span></a><a class="ns-method" href="tiled-collision_kind.html"><code class="nm-sig">Tiled.collision_kind(map, gid: int) -&gt; int</code><span class="nm-tip">Classify a GID's collision from its tile metadata.</span></a><a class="ns-method" href="tiled-tile_shapes.html"><code class="nm-sig">Tiled.tile_shapes(map, gid: int) -&gt; int</code><span class="nm-tip">Whether a GID's tile has a collision shape.</span></a><a class="ns-method" href="tiled-draw_anim.html"><code class="nm-sig">Tiled.draw_anim(map, camx: int, camy: int, frame: int) -&gt; void</code><span class="nm-tip">Draw with animated tiles advanced to a frame.</span></a><a class="ns-method" href="tiled-frame_gid.html"><code class="nm-sig">Tiled.frame_gid(map, gid: int, frame: int) -&gt; int</code><span class="nm-tip">The current GID of an animated tile at a frame.</span></a><a class="ns-method" href="tiled-animated.html"><code class="nm-sig">Tiled.animated(map, gid: int) -&gt; int</code><span class="nm-tip">Whether a GID's tile is animated.</span></a><a class="ns-method" href="tiled-object_count.html"><code class="nm-sig">Tiled.object_count(map, layer: int) -&gt; int</code><span class="nm-tip">How many objects an object layer holds.</span></a><a class="ns-method" href="tiled-object.html"><code class="nm-sig">Tiled.object(map, layer: int, index: int) -&gt; value</code><span class="nm-tip">An object on an object layer by index.</span></a><a class="ns-method" href="tiled-object_shape.html"><code class="nm-sig">Tiled.object_shape(object) -&gt; string</code><span class="nm-tip">Classify an object's shape.</span></a><a class="ns-method" href="tiled-prop.html"><code class="nm-sig">Tiled.prop(container, name: string) -&gt; string</code><span class="nm-tip">A custom property's value, with class-default fallback.</span></a><a class="ns-method" href="tiled-prop_int.html"><code class="nm-sig">Tiled.prop_int(container, name: string) -&gt; int</code><span class="nm-tip">A custom property parsed as an integer.</span></a><a class="ns-method" href="tiled-prop_type.html"><code class="nm-sig">Tiled.prop_type(container, name: string) -&gt; string</code><span class="nm-tip">A custom property's declared type.</span></a><a class="ns-method" href="tiled-load_types.html"><code class="nm-sig">Tiled.load_types(path: string) -&gt; int</code><span class="nm-tip">Load a project custom-type table.</span></a><a class="ns-method" href="tiled-template.html"><code class="nm-sig">Tiled.template(path: string) -&gt; value</code><span class="nm-tip">Read a template file into an object value.</span></a><a class="ns-method" href="tiled-spawn.html"><code class="nm-sig">Tiled.spawn(map, object, model: string) -&gt; int</code><span class="nm-tip">Spawn a Ludic entity from an object.</span></a><a class="ns-method" href="tiled-spawn_layer.html"><code class="nm-sig">Tiled.spawn_layer(map, layer: int, model: string) -&gt; int</code><span class="nm-tip">Spawn every object on a layer.</span></a><a class="ns-method" href="tiled-cell_x.html"><code class="nm-sig">Tiled.cell_x(map, x: int, y: int) -&gt; int</code><span class="nm-tip">The screen x of a tile cell for the map orientation.</span></a><a class="ns-method" href="tiled-cell_y.html"><code class="nm-sig">Tiled.cell_y(map, x: int, y: int) -&gt; int</code><span class="nm-tip">The screen y of a tile cell for the map orientation.</span></a><a class="ns-method" href="tiled-layer_kind.html"><code class="nm-sig">Tiled.layer_kind(map, layer: int) -&gt; int</code><span class="nm-tip">A layer's kind.</span></a><a class="ns-method" href="tiled-layer_opacity.html"><code class="nm-sig">Tiled.layer_opacity(map, layer: int) -&gt; string</code><span class="nm-tip">A layer's opacity.</span></a><a class="ns-method" href="tiled-layer_tint.html"><code class="nm-sig">Tiled.layer_tint(map, layer: int) -&gt; string</code><span class="nm-tip">A layer's tint colour.</span></a><a class="ns-method" href="tiled-layer_offsetx.html"><code class="nm-sig">Tiled.layer_offsetx(map, layer: int) -&gt; int</code><span class="nm-tip">A layer's horizontal offset.</span></a><a class="ns-method" href="tiled-layer_offsety.html"><code class="nm-sig">Tiled.layer_offsety(map, layer: int) -&gt; int</code><span class="nm-tip">A layer's vertical offset.</span></a><a class="ns-method" href="tiled-world.html"><code class="nm-sig">Tiled.world(path: string) -&gt; value</code><span class="nm-tip">Read a .world file.</span></a><a class="ns-method" href="tiled-world_count.html"><code class="nm-sig">Tiled.world_count(world) -&gt; int</code><span class="nm-tip">How many maps a world stitches.</span></a><a class="ns-method" href="tiled-world_map.html"><code class="nm-sig">Tiled.world_map(world, index: int) -&gt; value</code><span class="nm-tip">A world member map by index.</span></a></div>
<a class="back" href="api.html">← All symbols</a>
</main>
<script src="ludic-highlight.js"></script>
<script>Ludic.installCards(); Ludic.flashTarget();</script>
</body></html>