# rmp::MapObject

> One object placed in the map, as spawn_objects() hands it to the factory registered for its `type`: where it is, how big, and its properties.

Source: https://omardev29.github.io/rmp-docs/reference/classes/rmp-MapObject.html

struct `#include <rmp/tilemap.h>` [include/rmp/tilemap.h:89](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/tilemap.h#L89-L130)

struct MapObject

One object placed in the map, as `spawn_objects()` hands it to the factory registered for its `type`: where it is, how big, and its properties.

### `name`

std::string_view name

field [include/rmp/tilemap.h:90](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/tilemap.h#L90)

The Tiled object's name; "" for an LDtk entity

### `type`

std::string_view type

field [include/rmp/tilemap.h:91](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/tilemap.h#L91)

The LDtk entity; Tiled's `class`

### `iid`

std::string_view iid

field [include/rmp/tilemap.h:92](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/tilemap.h#L92)

LDtk's unique id, what an EntityRef field holds

### `position`

Vector2 position{}

field [include/rmp/tilemap.h:93](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/tilemap.h#L93)

THE CENTRE, like [`rmp::Object`](https://omardev29.github.io/rmp-docs/reference/classes/rmp-Object.html); the editors give a corner

### `size`

Vector2 size{}

field [include/rmp/tilemap.h:94](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/tilemap.h#L94)

Width and height in world units; {0,0} for a Tiled point

### `rotation`

float rotation = 0

field [include/rmp/tilemap.h:95](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/tilemap.h#L95)

Tiled's, in degrees clockwise; 0 for an LDtk entity

### `gid`

int gid = 0

field [include/rmp/tilemap.h:96](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/tilemap.h#L96)

0 when it is not a tile object

### `property_bool`, `property_int`, `property_float`

bool property_bool(std::string_view key, bool fallback = false) const

int property_int(std::string_view key, int fallback = 0) const

float property_float(std::string_view key, float fallback = 0) const

function [include/rmp/tilemap.h:102](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/tilemap.h#L102)

A property by name — an LDtk field, a Tiled custom property — or `fallback` when the object has none by that name or it holds another kind. `property_int()` also reads a float, cut towards zero, and `property_float()` also reads an int.

### `property_string`

std::string_view property_string(std::string_view key, std::string_view fallback = "") const

function [include/rmp/tilemap.h:106](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/tilemap.h#L106-L107)

The map's text, or `fallback` as it was given: its lifetime is yours.

### `property_point`, `property_count`

Vector2 property_point(std::string_view key, Vector2 fallback = {}) const

Vector2 property_point(std::string_view key, int index, Vector2 fallback = {}) const

int property_count(std::string_view key) const

function [include/rmp/tilemap.h:115](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/tilemap.h#L115-L116)

An LDtk Point field, as the WORLD position of the centre of the cell it names — the same units as `position`, so a patrol route or a platform's destination is used as it comes. A list of them (Array<Point>) is read by index; `property_count()` is how many there are, and 1 for any other field that exists. Enums read as text, colours as "#rrggbb", and an EntityRef as the iid of the entity it points at.
