Expand description
Tile map is a 2D “image”, made out of a small blocks called tiles. Tile maps used in 2D games to
build game worlds quickly and easily. See TileMap docs for more info and usage examples.
Modules§
- brush
- Tile map brush is a set of tiles arranged in arbitrary shape, that can be used to draw on a tile map. A brush resembles a tile set in that they are both collections of tiles, but they are distinct because a brush can be freely organized to suit whatever is most convenient while editing a tile map. The tiles of a brush can be moved at any time without consequence, and so can the pages. A brush is like a painter’s toolbox, where the sole purpose is to serve the painter’s convenience.
- tileset
- Tile set is a special storage for tile descriptions. It is a sort of database, that contains
descriptions (definitions) for tiles. Tiles are organized into pages. Each page has particular
(x,y) coordinates and each tile within the page has its own (x,y) coordinates, so finding a tile
requires two pairs of coordinates (x,y):(x,y), which is called a
TileDefinitionHandle.
Structs§
- Change
Flag - A record whether a change has happened since the most recent save.
- Custom
Tile Collider - Triangle data for a tile collider arranged in rectangle from (0,0) to (1,1). Custom tile colliders can be converted to and from strings, where the strings contain 2D vertex positions and triangle index triples. A group of two numbers is taken to be a 2D vertex position while a group of three numbers is taken to be an index triple, and the numbers are therefore parsed as ints. For example, “0,0 1,1 1,0 0,1,2” would be a valid string for a custom tile collider. The commas (,) are used to connect two numbers as being part of the same group. Any other characters are ignored, so this would also be accepted: “(0,0) (1,1) (1,0) [0,1,2]”.
- Iter
- Iterator for
OrthoTransformMap. - Keys
- Keys iterator for
OrthoTransformMap. - Macro
Tiles Update - This is a step in the process of performing an edit to a tile map when macros are involved.
It contains the tiles to be written and the positions within the brush that the tiles were
taken from. It is constructed from a
TransTilesUpdateby applying the transformation to the tiles. A None indicates that the tile is to be erased. - Option
Rect Iter - Iterator for the cells contained in an OptionTileRect.
- Option
Tile Rect - An option version of
TileRectthat contains nothing. - Ortho
Transform Map - A map from
Vector2<i32>to values. It can be transformed to flip and rotate the positions of the values. - Ortho
Transformation - The amount of an orthogonal transformation. The tranformation either includes an optional initial x-flip that turns (1,0) into (-1,0), or not. Following the optional flip, the object being transformed is rotated counter-clockwise by some number of right-angle turns: 0, 1, 2, or 3. Multiple transformations can be chained together for arbitrary sequences of x-flips, y-flis, clockwise and counter-clockwise rotations.
- Partial
Random Tile Source - A tile source that produces a random tile from the included set of tiles.
- Pattern
Bits PatternBitsrepresents a tile’s pattern as a 3x3 grid ofi8values for doing autotiling in 2D withVector2<i32>positions. The center of the 3x3 grid is called the pattern’s terrain. The 8 values around the outside of the grid are called the pattern’s peering bits.- Random
Tile Source - A tile source that produces a random tile from the included set of tiles.
- Rect
Iter - Iterator for the cells contained in a TileRect.
- Repeat
Tile Source - A tile source that adapts another source so that it infinitely repeats the tiles within the given rect.
- RotTile
Handle - A stamp element plus the transformation of the
Stampwhere the element is taken from, allowing the stamp element itself to be later transformed before it is applied to a tile map, tile set, or brush. - Single
Tile Source - A tile source that always produces the same tile.
- Stamp
- A set of tiles and a transformation, which represents the tiles that the user has selected to draw with.
- Stamp
Element - Each cell of a stamp must have a tile handle and it may optionally have the handle of a brush cell where the tile was taken from.
- Tile
- Tile is a base block of a tile map. It has a position and a handle of tile definition, stored in the respective tile set.
- Tile
Cursor Effect - Renders a rectangle of the given material at the given position in the tile map.
- Tile
Definition Handle - Position of a tile definition within some tile set
- Tile
Definition Handle Parse Error - An syntax error in parsing a TileDefinitionHandle from a string.
- Tile
Erase Effect - Sets the tiles at the given positions to invisible.
- Tile
Grid Map - A 2D grid that contains tile data.
- Tile
Iter - Adapt an iterator over positions into an iterator over
(Vector2<i32>, TileHandleDefinition). - TileMap
- Tile map is a 2D “image”, made out of a small blocks called tiles. Tile maps used in 2D games to
build game worlds quickly and easily. Each tile is represented by a
TileDefinitionHandlewhich contains the position of a page and the position of a tile within that page. - Tile
MapBuilder - Tile map builder allows you to create
TileMapscene nodes. - Tile
MapData - Asset containing the tile handles of a tile map.
- Tile
MapData Iterator - Iterator over the tiles of a
TileMapDatain the form of (position, handle). - Tile
MapData Ref - A reference to the tile data of a some tile in a tile set.
- Tile
MapRender Context - Context for rendering tiles in a tile map. It is especially used by
TileMapEffectobjects. - Tile
Overlay Effect - Draws the given tiles with the given offset, and sets the drawn tile positions to invisible so that no other tiles will be drawn there.
- Tile
Rect - This is a variation of
Rectthat is specifically designed for use with TileMap. While the y-axis ofRectpoints downward to match the y-axis of UI, the y-axis ofTileRectpoints upward to match the y-axis of TileMap, TileSet, and TileMapBrush. - Tile
Region - A region of tiles to be filled from some source of tiles.
- Tile
Render Data - The specification for how to render a tile.
- Tile
Selection Effect - Renders borders of the given material around the given positions in the tile map.
- Tile
SetAuto Tile Context - This is a specialization of
AutoTileContextfor use with aTileSet. The pattern of each tile is taken from the values of a nine-slice property, andTileDefinitionHandleis used to represent individual tiles. - Tile
SetAuto Tiler - Autotiler for the tiles of a
TileSetthat uses the nine-slice values of one of the tile set’s properties as the auto-tiler’s pattern. - Tile
SetPattern Source - An object that wraps a tile map, a tile set, an update, and the UUID of the property that is used to store the pattern of each tile, and then provides access to the pattern at any cell. It looks for the cell’s handle in the update, then in the tile map, and then uses the tile set to find the pattern.
- Tile
SetUpdate - This represents a change to some pages of a tile set, without specifying which tile set.
- Tile
SetWfc Constraint - A hash table based wave function collapse constraint that maps
PatternBitsobjects to sets ofTileDefinitionHandle. Each handle refers to a tile, and each tile is assigned a pattern and a frequency. The sum of the frequencies of all a pattern’s tiles becomes the frequency of the pattern, which is then normalized into a probability between 0.0 and 1.0 for use as a constraint for aTileSetWfcPropagatorwhich will perform the wave function collapse. - Tile
SetWfc Propagator - Wave function collapse propagator for the tiles of a
TileSetthat uses the nine-slice values of one of the tile set’s properties as the wave function’s pattern. - Tile
Update Effect - Uses the given tile update to render the replacement tiles and make the erased tiles invisible.
- Tile
Vertex - A vertex for tiles.
- Tiles
- A set of tiles.
- Tiles
Update - A set of changes to a set of tiles. A value of None indicates that a tile is being removed from the set. A None indicates that the tile is to be erased.
- Trans
Tiles Update - This is a step in the process of performing an edit to a tile map, brush, or tile set. It provides handles for the tiles to be written and the transformation to apply to those tiles. A None indicates that the tile is to be erased.
- Transform
SetCell - TransformSetCell represents a position within a transform set page and the corresponding transform. This object fascilitates using a transform set page to transform tiles by moving between positions in the page based on the desired transformation.
Enums§
- Custom
Tile Collider StrError - Errors that may occur while parsing a custom tile collider.
- Fill
Pattern MapError - An error that might occur while filling a pattern map from a tile set
using
TileSetAutoTileContext::fill_pattern_map. - Material
Update - A change of material for some tile. Either the material is being erased, or it is being replaced by the given material.
- Page
Type - Tile pages come in these types.
- Resource
Tile Position - The position of a page or a tile within a tile resource.
Despite the difference between pages and tiles, they have enough similarities
that it is sometimes useful to view them abstractly as the same.
Both pages and tiles have a
Vecto2<i32>position. Both pages and tiles have a TileDefinitionHandle and are rendered usingTileRenderData. For pages this is due to having an icon to allow the user to select the page. Both pages and tiles can be selected by the user, moved, and deleted. - Tile
Book - Abstract source of tiles, which can either be a tile set or a brush. It is called a “book” because each of these tile resources contains pages of tiles.
- Tile
Collider - Supported collider types for tiles.
- Tile
Data Update - This represents a change to a tile in some tile set.
- Tile
Palette Stage - Each brush and tile set has two palette areas: the pages and the tiles within each page.
These two areas are called stages, and each of the two stages needs to be handled separately.
Giving a particular
TilePaletteStageto a tile map palette will control which kind of tiles it will display. - Tile
Property Error - An error in finding a property for a tile.
Constants§
- VERSION
- Current implementation version marker.
Statics§
- DEFAULT_
TILE_ MATERIAL - The default material for tiles that have no material set.
Traits§
- Bounded
Tile Source - A trait for types that can produce a TileDefinitionHandle upon demand, for use with drawing on tilemaps.
- Ortho
Transform - Trait for objects that can perform a 2D orthogonal transformation. In other words, they can be flipped along the x and y axis, and they can be rotated by multiples of 90 degrees.
- Tile
MapEffect - A trait for objects that can perform specialized rendering for a tile map by
adding them to
TileMap::before_effectsorTileMap::after_effects, depending on whether the effect should render before the tile map renders or after the tile map renders. - Tile
Source - A trait for types that can produce a TileDefinitionHandle upon demand, for use with drawing on tilemaps.
Type Aliases§
- Custom
Tile Collider Resource - A resource to hold triangle data for a tile collider arranged in rectangle from (0,0) to (1,1).
- Palette
Position - The type of coordinates stored in a a TileDefinitionHandle.
- Tile
MapData Resource - Resource for storing the tile handles of a tile map.
- Tile
MapEffect Ref - A reference to
TileMapEffect. A TileMap keeps some of these if it needs to be rendered specially. - Tile
SetAuto Tile Constraint - A pair of a
TileSetConstraintMapand aTileSetTerrainPatternMap. - Tile
SetAuto Value Map - A mapping from auto-tiler patterns to tile handles. Multiple tiles may share the same pattern, and each tile is given a frequency value that controls the probability of randomly selecting that tile when its pattern is chosen.
- Tile
SetConstraint Map - A map from
Vector2<i32>positions to auto-tile cell constriants. Each cell contraint is either anTileTerrainIdwhich represents the center of the permitted patterns for this cell, or else it is aPatternBitswhich represents the only permitted pattern for this cell and thereby constrains the neighboring cells. - Tile
SetTerrain Pattern Map - A terrain pattern map for tile map auto-tiler, using the fields of a nine-slice tile set property for the terrain types and the patterns.
- Tile
Terrain Id - A value that specifies the terrain of a tile map cell for auto-tiling. This value comes from the center of a nine-slice tile set property, so it can constrain which tiles are permitted in a particular cell.