Tile format: Difference between revisions

Jump to navigation Jump to search
1,388 bytes added ,  26 January 2023
Add per-cell links section
m (minor typo)
(Add per-cell links section)
Line 59: Line 59:


== Per-Cell Links ==
== Per-Cell Links ==
All link data is stored within the "cell_props" object in "properties". Since a cell can store only one link no matter the type (URL link or coordinate link), each link is addressed by its Y and X cell coordinates. The "cell_props" object stores all the rows of a tile as Y coordinates. Each row is an object which then contains all the X coordinates for that row. The X coordinates are yet another object which stores the property for that specific cell. Since only links are supported within cell_props at the time of writing, the only property that can be inside this object is "link". The link property can only store information for either a URL link or a coordinate link, as shown below<syntaxhighlight lang="text">
link =>
    type: "url"
    url: <string>
link =>
    type: "coord"
    link_tileX: <number>
    link_tileY: <number>
</syntaxhighlight>Here is an example of a "cell_props" object containing a URL link to the YouTube homepage at the top middle of a tile, and a coordinate link to (0, 100) at the top right<syntaxhighlight lang="json">
{
    "0": {
        "8": {
            link: {
                type: "url",
                url: "https://www.youtube.com/"
            }
        },
        "15": {
            link: {
                type: "coord",
                link_tileX: 0,
                link_tileY: 100
            }
        }
    }
}
</syntaxhighlight>

Navigation menu