Module tilemap

Module tilemap 

Source
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§

ChangeFlag
A record whether a change has happened since the most recent save.
CustomTileCollider
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.
OptionRectIter
Iterator for the cells contained in an OptionTileRect.
OptionTileRect
An option version of TileRect that contains nothing.
OrthoTransformMap
A map from Vector2<i32> to values. It can be transformed to flip and rotate the positions of the values.
OrthoTransformation
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.
PartialRandomTileSource
A tile source that produces a random tile from the included set of tiles.
RandomTileSource
A tile source that produces a random tile from the included set of tiles.
RectIter
Iterator for the cells contained in a TileRect.
RepeatTileSource
A tile source that adapts another source so that it infinitely repeats the tiles within the given rect.
SingleTileSource
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.
TileCursorEffect
Renders a rectangle of the given material at the given position in the tile map.
TileDefinitionHandle
Position of a tile definition within some tile set
TileDefinitionHandleParseError
An syntax error in parsing a TileDefinitionHandle from a string.
TileEraseEffect
Sets the tiles at the given positions to invisible.
TileGridMap
A 2D grid that contains tile data.
TileIter
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 TileDefinitionHandle which contains the position of a page and the position of a tile within that page.
TileMapBuilder
Tile map builder allows you to create TileMap scene nodes.
TileMapData
Asset containing the tile handles of a tile map.
TileMapDataIterator
Iterator over the tiles of a TileMapData in the form of (position, handle).
TileMapDataRef
A reference to the tile data of a some tile in a tile set.
TileMapRenderContext
Context for rendering tiles in a tile map. It is especially used by TileMapEffect objects.
TileOverlayEffect
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.
TileRect
This is a variation of Rect that is specifically designed for use with TileMap. While the y-axis of Rect points downward to match the y-axis of UI, the y-axis of TileRect points upward to match the y-axis of TileMap, TileSet, and TileMapBrush.
TileRegion
A region of tiles to be filled from some source of tiles.
TileRenderData
The specification for how to render a tile.
TileSelectionEffect
Renders borders of the given material around the given positions in the tile map.
TileSetUpdate
This represents a change to some pages of a tile set, without specifying which tile set.
TileUpdateEffect
Uses the given tile update to render the replacement tiles and make the erased tiles invisible.
TileVertex
A vertex for tiles.
Tiles
A set of tiles.
TilesUpdate
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.
TransTilesUpdate
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.
TransformSetCell
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§

CustomTileColliderStrError
Errors that may occur while parsing a custom tile collider.
MaterialUpdate
A change of material for some tile. Either the material is being erased, or it is being replaced by the given material.
PageType
Tile pages come in these types.
ResourceTilePosition
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 using TileRenderData. 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.
TileBook
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.
TileCollider
Supported collider types for tiles.
TileDataUpdate
This represents a change to a tile in some tile set.
TilePaletteStage
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 TilePaletteStage to a tile map palette will control which kind of tiles it will display.
TilePropertyError
An error in finding a property for a tile.

Constants§

VERSION
Current implementation version marker.

Traits§

BoundedTileSource
A trait for types that can produce a TileDefinitionHandle upon demand, for use with drawing on tilemaps.
OrthoTransform
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.
TileMapEffect
A trait for objects that can perform specialized rendering for a tile map by adding them to TileMap::before_effects or TileMap::after_effects, depending on whether the effect should render before the tile map renders or after the tile map renders.
TileSource
A trait for types that can produce a TileDefinitionHandle upon demand, for use with drawing on tilemaps.

Type Aliases§

CustomTileColliderResource
A resource to hold triangle data for a tile collider arranged in rectangle from (0,0) to (1,1).
PalettePosition
The type of coordinates stored in a a TileDefinitionHandle.
TileMapDataResource
Resource for storing the tile handles of a tile map.
TileMapEffectRef
A reference to TileMapEffect. A TileMap keeps some of these if it needs to be rendered specially.