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]”.
- DEFAULT_
TILE_ MATERIAL - The default material for tiles that have no material set.
- Iter
- Iterator for
OrthoTransformMap. - Keys
- Keys iterator for
OrthoTransformMap. - 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.
- 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.
- 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.
- 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
SetUpdate - This represents a change to some pages of a tile set, without specifying which tile set.
- 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.
- 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.
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.