Struct rust_rpg_toolkit::map::Map[][src]

pub struct Map {
    pub background_color: Color,
    pub world_offset: Vec2,
    pub grid_size: UVec2,
    pub tile_size: Vec2,
    pub layers: HashMap<String, MapLayer>,
    pub tilesets: HashMap<String, MapTileset>,
    pub draw_order: Vec<String>,
    pub properties: HashMap<String, MapProperty>,
    pub player_spawn_point: Option<Vec2>,
}

Fields

background_color: Colorworld_offset: Vec2grid_size: UVec2tile_size: Vec2layers: HashMap<String, MapLayer>tilesets: HashMap<String, MapTileset>draw_order: Vec<String>properties: HashMap<String, MapProperty>player_spawn_point: Option<Vec2>

Implementations

Trait Implementations

Retrieve the map’s dimensions. Made optional to reduce API breakage.

Convert a Point (x/y) to an array index. Defaults to an index based on an array strided X first. Read more

Convert an array index to a point. Defaults to an index based on an array strided X first. Read more

True is you cannot see through the tile, false otherwise. Default implementation always returns true, and is provided so you don’t have to implement it if you aren’t using it. Read more

Return a vector of tile indices to which one can path from the idx. These do NOT have to be contiguous - if you want to support teleport pads, that’s awesome. Default implementation is provided that proves an empty list, in case you aren’t using it. Read more

Return the distance you would like to use for path-finding. Generally, Pythagoras distance (implemented in geometry) is fine, but you might use Manhattan or any other heuristic that fits your problem. Default implementation returns 1.0, which isn’t what you want but prevents you from having to implement it when not using it. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.