Tilemaps.core
Defines the tilemaps core plugin.
This static class contains constant string representations of certain resource names.
Provides event arguments for changes that affect a certain region,
such as editing operations or runtime modifications of a .
[GET] The top left position of the affected region.
[GET] The size of the affected region, starting from .
Specifies a source of collision information.
The that will serve as a provider for collision information.
A bitmask that will specify which collision layers to use
from the .
Aggregates a single tile's multi-layer collision info.
The tiles collision shape on the default layer.
The tiles collision shape on first auxilliary layer.
The tiles collision shape on second auxilliary layer.
The tiles collision shape on third auxilliary layer.
[GET / SET] The collision shape on a given layer index from zero to ( - 1).
[GET] The collision shape on the specified (set of) layer(s).
Defines the collision shape of a single tile by specifying
whether each of its corners is blocked, in addition to a central
"filled" flag.
The tile is completely empty. No collision at all.
The tiles top edge is considered solid.
The tiles bottom edge is considered solid.
The tiles left edge is considered solid.
The tiles right edge is considered solid.
A solid diagonal edge from the tiles bottom left to its
top right corner is assumed.
A solid diagonal edge from the tiles top left to its
bottom right corner is assumed.
All collision bits are set. This is generally true for tiles that are
completely impassable / solid.
Extends the description of a single input tile by defining its role in an AutoTile.
Whether or not this tile is considered part of the AutoTile mapping.
Whether or not an AutoTile of this type will connect to this tile.
This will be assumed true by all tiles where is true.
Describes which neighbourhood tiles the tile needs to connect to in order to
match this AutoTile mapping.
Specifies the 8-neighbour connectivity of a tile to its neighbouring tiles.
Describes a single tile in a compiled .
The data block is generated during compilation
based on data and settings.
The tile's coordinates in the first of the .
They are stored here as a measure of performance optimization for quick access - for UV information on
other instances of the , use .
The tile's depth offset, measured in tiles.
The AutoTile layer number (index + 1) inside the this tile belongs to.
Specifies the per-layer collision shape of this tile.
Specifies whether the tile is standing upright / vertical, as opposed to being flat on its surface.
Specifies whether the tile can be considered visually empty, e.g. by being completely transparent.
A single in a .
The final, all-things-considered index in the to which this refers.
You usually wouldn't change this value directly, but change instead, as
will be updated based on , but not the other way around. When you change this value, make sure
to invoke afterwards. If you want to initialize a new tile, just use one of the constructors.
This value isn't serialized, but generated afterwards, since it may change when the
configuration changes. Since some tiles might be auto-generated, it is not guaranteed that this index is
also valid in non-compiled source data.
The base / source tile index in the to which this refers.
The is a valid index in the source data, even if the
actually displayed and used was generated during compilation.
The depth offset of the , measured in tiles.
The connection state of this with regard to AutoTiling rules.
Initializes a new tile with the specified and the default connectivity.
The will be resolved when set in a .
If the specified base index refers to an AutoTile with a different connectivity than the default
one, the actual index of the tile may change when resolved.
Initializes a new tile with the specified and AutoTile connectivity.
The will be resolved when set in a .
Initializes a new tile with the specified and derives all other values
from their defaults as specified in the provided .
This guarantees that, even for AutoTiles, the specified will be used
directly as-is, without the resolve step adjusting it. When possible, prefer other methods of
initializing tiles, as this one is more expensive than the others.
Resolves the of the based on
its and .
Resolves the of the based on
its and .
Resolves the values of the specified tile array segment.
Resolves the values of the specified grid area.
Resolves the values of the specified grid area, given the grid's raw data block.
Updates the state of a rectangular region on the specified tile grid
based on its connectivity state with neighbouring tiles.
Updates the state of an arbitrary region on the specified tile grid
based on its connectivity state with neighbouring tiles.
A custom data structure for efficiently storing and querying vertex / corner node connectivity in a .
Each coordinate in a refers to a single vertex / corner node and stores a bitmask of all connections
to its 8-tile neighbourhood. All connections are considered bidirectional.
Adds a new edge connection to the .
Both specified nodes need to be adjacent to each other.
Removes an existing edge connection from the .
Both specified nodes need to be adjacent to each other.
Determines whether the specified edge is part of the .
Both specified nodes need to be adjacent to each other.
Starting from the specified node, this method returns the first neighbour
that is connected to it, starting at the one directly above it and proceeding clockwise.
Returns (-1, -1) if no neighbour is connected.
Finds the first node that is connected to any other node.
Returns (-1, -1) if no node is connected to any other.
Clears all edges / connections between nodes.
[GET] The amount of vertices / corner nodes on the horizontal axis.
[GET] The amount of vertices / corner nodes on the vertical axis
Represents a block of data.
Represents an unknown version.
Represents the zip-compressed byte array version.
Represents the first version that includes depth offsets.
Represents the first version that includes AutoTile data.
The lowest version identifier that can be handled in deserialization.
The highest version identifier that can be handled in deserialization.
[GET] The tile data that is stored within this instance.
[GET] The number of tiles on each axis.
Uses the information from the local to configure the local for
simulating physical interaction with the .
Updates the internal shape property values by averaging existing generated shapes.
If there are no existing shapes, the internal shape proprety values are left untouched.
[GET / SET] The origin of the generated shapes, relative to the position of its .
[GET / SET] Specifies which components and collision layers to use
to generate the collision shape.
[GET / SET] Whether the will generate solid edges at the tilemaps outer borders.
[GET / SET] Whether the will attempt to generate rounded corners instead of sharp ones.
[GET] The rectangular region that is occupied by the generated shapes, in local / object space.
A helper class that provides algorithms for determining the visible tile area for a given .
An empty culling result that indicates no rendering is necessary at all.
Determines the rectangular tile area that is visible to the specified .
Input parameters for a culling operation, detailing world transform and
tile extent.
World space position of the .
World space scale of the .
World space rotation of the .
The size of a single tile in the .
The total number of tiles in the .
The end result of a culling operation, specifying the rectangular area
of the that is to be rendered, as well as view space transform data
which can be used for doing so.
The top left origin of the visible rect, in tile coordinates.
The number of visible tiles to render, starting from .
The view space rendering origin of the visible tile rect.
The view space x axis of the rendered , taking rotation and scale into account.
The view space y axis of the rendered , taking rotation and scale into account.
The world space rendering origin of the visible tile rect.
The world space x axis of the rendered , taking rotation and scale into account.
The world space y axis of the rendered , taking rotation and scale into account.
Describes an interface for a that renders a .
This interface is typically used by the editor to query data for providing
editing capabilities.
Given the specified coordinate in local / object space, this method returns the
tile index that is located there.
Specifies the desired behavior when attempting to get a tile outside the rendered area.
Gets the local position of the specified tile at the upper left corner.
The function does not check if the point is a valid tile position.
The index of the tile of which to calculate the local position.
Determines the generated depth offset for the tile at the specified tile coordinates.
This also inclues the renderers overall depth offset.
The index of the tile of which to calculate the depth offset.
[GET] A reference to the that is currently rendered by this .
[GET] The rectangular region that is occupied by the rendered , in local / object space.
[GET] Returns the size of a single tile in local / object space.
[GET / SET] A color by which the rendered is tinted.
[GET] The base depth offset that will be used when rendering a non-flat / deep .
This property represents the sum of all non-local depth adjustments in the rendered ,
expressed as an offset to the depth that is implicitly defined by the Z position.
Specifies the way in which depth offsets are generated per-tile.
All tiles share the same depth offset.
A tile's depth offset is derived from its local position in the tilemap.
A tile's depth offset is derived from its world-space position.
Specifies the desired behavior when picking a tile outside the rendered area.
Negative and out-of-bounds coordinates are returned.
The returned tile coordinates are clamped to the available rendered area.
Coordinates outside the rendered area are rejected.
Renders a that either belongs to the same
or is referenced by .
Given the specified coordinate in local / object space, this method returns the
tile index that is located there.
Specifies the desired behavior when attempting to get a tile outside the rendered area.
Gets the local position of the specified tile at the upper left corner.
The function does not check if the point is a valid tile position.
The index of the tile of which to calculate the local position.
Determines the generated depth offset for the tile at the specified tile coordinates.
This also inclues the renderers overall offset as specified in ,
but ignores all actual per-tile and tileset depth offsets. The specified tile position
is considered virtual and does not have to be within the valid tile position range.
The index of the tile of which to calculate the depth offset.
[GET] The base depth offset that will be used when rendering a non-flat / deep .
This property represents the sum of all non-local depth adjustments in the rendered ,
expressed as an offset to the depth that is implicitly defined by the Z position.
This offset is automatically calculated based on and .
[GET / SET] The depth offset for the rendered that is added
to each output vertex without contributing to perspective effects such as parallax.
[GET / SET] An offset measured in tiles that is assumed in the depth offset generation.
With an offset of one, each tile will be rendered with the base offset of "one tile higher up".
This can be used as a quick way to layer different tilemaps on each other where each layer
represents a certain world space height. The same effect can be achieved by carefully adjusting
the .
[GET / SET] The depth offset scale that is used to determine how much depth each
tile / pixel / unit adds when using non-flat depth offset generation.
[GET / SET] Specifies the way in which depth offsets are generated per-tile.
[GET / SET] A color by which the rendered is tinted.
[GET / SET] The origin of the rendered as a whole, relative to the position of its .
[GET / SET] The that should be rendered.
If this is null, the local on the same is used.
[GET] A reference to the that is currently rendered by this .
[GET] The rectangular region that is occupied by the rendered , in local / object space.
[GET] Returns the size of a single tile in local / object space.
A Component holds the actual map information that is used by other Components to display and interact with.
Without the appropriate renderer, it remains invisible and without the appropriate collider, it won't interact physically.
Sets a single tile at the specified position.
Resizes the .
Clears the without modifying its size.
Begins an external update operation to the tile data stored in the . Calling this
method will grant direct write access to the internal tile data. No data will be copied.
Note that you are not required to call this method when using other API to update
tile data. Instead, use this method only when direct write access to the internal tile data should be
acquired.
The internal tile data of the , which can now be modified externally
Ends an external update operation to the tile data stored in the . Calling this
method will notify other classes about changes, so they can update
themselves. By specifying exactly which rectangular region was affected by the operation,
these updates can be performed a lot faster.
Ends an external update operation to the tile data stored in the . Calling this
method will notify other classes about changes, so they can update
themselves. However, since no specific region is specified that is affected by the operation,
a potentially expensive full update needs to be performed.
Resolves the value of all tiles in the specified area.
[GET / SET] The that defined the properties of each type of .
[GET] An interface providing read access to the tile data in this .
[GET] The number of tiles on each axis.
A bitmask that specifies which collision layers are addressed in a .
No collision layers at all.
The default collision layer.
The first auxilliary collision layer.
The second auxilliary collision layer.
The third auxilliary collision layer.
All collision layers.
Describes a single tile input in a .
When compiling a , these inputs are transformed into
a data block which can then be used by
Components and others.
The tile's depth offset, measured in tiles.
Whether the tile is standing upright / vertical, as opposed to being flat on its surface.
Specifies the per-layer collision shape of this tile.
Modifies the specified fallback map so that all permutations of the specified
base fallback and state flags map back to the base fallback.
Generates a transitive fallback map where each item is a sorted list of all items in the items fallback chain.
Contains output data that was produced or modified by a .
The overall number of tiles in the compiled tileset.
Per-tile information providing collision and rendering cues.
Corresponds to the tile input that was specified in the .
One texture for each visual layer. Corresponds to the visual
layers that were specified in the .
One AutoTile info for each AutoTile type. Corresponds to the
AutoTile input that was specified in the .
Specifies input data for the to work with.
Input tile data. This data is not modified, but provided in
mutable form for performance reasons / to allow direct array access.
Visual layer configuration. This data is not modified, only read.
AutoTile configuration. This data is not modified, only read.
(Optional) potentially existing output that was produced in previous compilations.
A may choose to re-use some of the data
structures provided here, so they might be returned as output in modified form.
The encapsulates the process of transforming raw source data
of a into an optimized and enriched target dataset, which will then
be provided by the for rendering and collision detection.
Compiles a using its specified source data, in order to
generate optimized target data for rendering and collision detection.
Transforms regular AutoTile input data into an output format that is optimized for
efficient reading and updating operations.
Determines the overall geometry of a single visual layer. This involves
tile boundaries in source and target data, as well as texture sizes and similar.
Generates pixel and atlas data for a single visual layer.
Transforms regular data into compiled output data
and enhances it with performance-relevant additional information in the process.
Fills up the specified spacing around a tile's pixel data with colors that are
similar to the existing edge colors in order to prevent filtering artifacts
when rendering them as a texture atlas.
Determines whether the specified pixel data block is completely transparent in
the specified area.
Describes a single auto-tile as generated during a compilation process.
Creates a new based on prepared data.
The tile index of the base tile for this AutoTile.
An array where the item at a index represents the tile index
of the border tile to use in this connectivity setup. This array is not copied. If you plan
to re-use it, pass a copy as a parameter.
[GET] The tile index inside the that is considered to be the base
tile representing the entire set of connection-dependend tiles inside this auto-tile.
[GET] An readonly list where the item at a index represents the tile index
of the border tile to use in this connectivity setup.
[GET] A readonly list where each item extends the regular description by
AutoTile-specific information, such as its matching connectivity state, or whether it is considered to
connect to this AutoTile.
Describes a single auto-tile input in a definition. When compiling the ,
these settings are mapped and transformed into one data structure for each
that was defined.
[GET / SET] The human-friendly name of this AutoTile.
[GET / SET] The id of this AutoTile input, which can be used by game and editor code to identify it.
[GET / SET] The tile index inside the that is considered to be the base
tile representing the entire set of connection-dependend tiles inside this AutoTile.
[GET] Provides additional per-tile AutoTile information that will be evaluated
during compilation.
Describes a single rendering input in a definition. Each tile's visual representation is
composed of all rendering inputs that are defined in a - essentially, they are mapped to
the different texture inputs used when rendering each tile.
Determines the total number of tiles in horizontal and vertical direction, given the
specified source image size.
[GET / SET] The human-friendly name of this rendering input.
[GET / SET] The id of this rendering input, which can later be used for mapping it to texture slots, etc.
[GET / SET] The source pixel data from which this rendering input will be created. This may end up to be equal to the actually used
pixel data, but it doesn't necessarily have to be, as the is allowed to make internal modifications and optimizations
while preparing the data for rendering.
[GET / SET] The width and height (in pixels) of each tile in the specified source data. This is usually equal in all
rendering inputs of a . Whether or not this tile size is used in the generated target data is up to the
implementation.
[GET / SET] The spacing (in pixels) around each tile in the source data. A spacing of one means that there is a 1-pixel-wide space between
two adjacent tiles. It doesn't imply that there is a spacing on any side of the source image.
[GET / SET] The margin (in pixels) around each tile in the target data. A margin of one means that there is a 1-pixel-wide space on
each side of every tile, meaning that the actual space between two tiles will be two pixels. The spacing is also applied on edges of the
provided pixel data, meaning that the spacing will also generate an offset for top-left and bottom-right tiles.
Whether or not this tile spacing is used in the generated target data is up to the implementation.
[GET / SET] The target data's magnification (zooming in) filtering algorithm.
[GET / SET] The target data's minification (zooming out) filtering algorithm.
[GET / SET] The internal texture format of the generated target data.
[GET] The number of pixels to skip when advancing from one tile in the source image to the next.
[GET] The number of pixels to skip when advancing from one tile in the target texture to the next.
Resources define the tiles that are used by , and Components
to update and display tilemaps, as well as define interactions between them and the world.
Looks up the vertex UV rect for the specified rendering input / data and tile.
Looks up the source pixel coordinates for the specified input layer and tile.
Compiles the using the specified source data, in order to
generate optimized target data for rendering and collision detection.
Generates the from the currently available
and .
Discards all data that was acquired during .
Discards a previously generated . Does not discard any
other generated data.
Determines the -relevant hash code of the specified .
This value is used internally to determine whether a needs to be recompiled.
[GET] A configuration template that is used for generating the output .
[GET] The different layers of , which compose the look of all the tiles
that are defined in this .
[GET] The different auto-tile definitions of this , each specified by
a single . This data is user-defined and pre-compilation.
To access post-compile data, see the property.
[GET / SET] The desired size of a tile in world space. How exactly this value is accounted for depends
on the Components that evaluate it for rendering, collision detection, etc.
[GET / SET] Provides information about each tile in the .
This information is transformed in the compilation process of a
in order to form the that will be used for determining
tile behaviour.
[GET] The number of tiles in this . Calculated during compilation.
[GET] The that has been compiled from the specified .
[GET] Provides information about each compiled auto-tile in the .
This information is generated during the compilation process of a .
To change any of the settings, instead check out the property.
[GET] Provides information about each compiled tile in the .
This information is generated during the compilation process of a .
Do not modify. The only reason this is not read-only is to provide raw / optimized
array access in bottleneck paths such as rendering.
[GET] Whether this has been compiled yet or not.
[GET] Returns a hash value that represents the configuration that was used
when compiling the .
[GET] Determines whether the has changed since the last
time it was compiled. Always true, if the has never been
compiled before.