[−][src]Module rs_tiled_json::object
Objects are accessed usually through Object Group layers.
Objects in Tiled describe just a couple of things:
- Text
- Points
- Ellipses
- Polygons
- Polylines
How you use these things is up to you. For example, Tile definitions in Tilesets contain objects when collision or locations within tiles have been identified in the Tiled editor. You might use these to describe common paths for NPCs to take or collisions or meshes or text-on-map.
Please see: https://doc.mapeditor.org/en/stable/reference/json-map-format/#object
Objects implement the HasProperty trait in order to provide access to Properties. The relevant functions are: tiled_json::Object::get_property(&self, name: &str) -> Option<&tiled_json::Property>; tiled_json::Object::get_property_vector(&self) -> &Vec<tiled_json::Property>; tiled_json::Object::get_property_value(&self, name: &str) -> Option<&tiled_json::PropertyValue>; // See the tiled_json::Property struct to see functionality offered.
Structs
Object | Means of describing nodes in objectgroup layers. |
Point | Points describe single points on maps and are generally used to describe polygons and polylines. They only have x and y components. |
Text | Text is an oject that contains all kinds of characteristics of text that Tiled is able to display, including the string itself. |
Enums
HAlign | This enum describes the horizontal alignment of text. It has 4 variants: |
VAlign | This enum describes the vertical alignment of text. It has 3 variants: |