Skip to main content

TileSource

Trait TileSource 

Source
pub trait TileSource {
    // Required methods
    fn brush(&self) -> Option<&TileMapBrushResource>;
    fn transformation(&self) -> OrthoTransformation;
    fn get_at(&self, position: Vector2<i32>) -> Option<StampElement>;
}
Expand description

A trait for types that can produce a TileDefinitionHandle upon demand, for use with drawing on tilemaps.

Required Methods§

Source

fn brush(&self) -> Option<&TileMapBrushResource>

The source where these tiles were originally taken from.

Source

fn transformation(&self) -> OrthoTransformation

The transformation that should be applied to the tiles before they are written.

Source

fn get_at(&self, position: Vector2<i32>) -> Option<StampElement>

Produce a tile definition handle for the given position. If an area of multiple tiles is being filled, then the given position represents where the tile will go within the area.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§