Tileset
namespace Griff.Scenes;
public sealed class TilesetOne of a tilemap’s tilesets (see Tilesets): Image cut into Columns by Rows tiles, numbered from First along each row, top row first. Without an image its tiles are squares of the map’s tint.
Properties
Section titled “Properties”Columns
Section titled “Columns”public int Columns { get; init; }public int Count { get; }How many tiles it has.
public int End { get; }One past its last tile’s number.
public int First { get; init; }public string? Image { get; init; }public string Name { get; }Its image’s file name without the folder or extension (“props”), or “Tiles” without an image.
public int Rows { get; init; }Methods
Section titled “Methods”Contains
Section titled “Contains”public bool Contains(int tile)True if tile is one of its own tiles.
Deconstruct
Section titled “Deconstruct”public void Deconstruct(out string? Image, out int Columns, out int Rows, out int First)Equals
Section titled “Equals”public override bool Equals(object? obj)Equals
Section titled “Equals”public bool Equals(Tileset? other)GetHashCode
Section titled “GetHashCode”public override int GetHashCode()public static Tileset? Parse(string? line, int first)Reads a line of MoreTilesets, “Tiles/props.png 4x4”, as a tileset whose tiles start at first; null for a blank line. Without its tiles across and down, it’s one tile.
public Vector4 Rect(int tile)The part of Image showing tile, as (u, v, width, height) in 0–1 image space. Numbers outside its tiles wrap round them.
ToLine
Section titled “ToLine”public string ToLine()The line Parse reads back, as MoreTilesets holds it: “Tiles/props.png 4x4”.
ToString
Section titled “ToString”public override string ToString()