[][src]Struct rs_tiled_json::object::Object

pub struct Object {
    pub id: u32,
    pub x: f64,
    pub y: f64,
    pub gid: Option<u32>,
    pub name: String,
    pub otype: String,
    pub height: f64,
    pub width: f64,
    pub rotation: f64,
    pub visible: bool,
    pub ellipse: bool,
    pub point: bool,
    pub polygon: Option<Vec<Point>>,
    pub polyline: Option<Vec<Point>>,
    pub text: Option<Text>,
    pub properties: Vec<Property>,
}

Means of describing nodes in objectgroup layers.

Fields

id: u32x: f64y: f64gid: Option<u32>name: Stringotype: Stringheight: f64width: f64rotation: f64visible: boolellipse: boolpoint: boolpolygon: Option<Vec<Point>>polyline: Option<Vec<Point>>text: Option<Text>properties: Vec<Property>

Methods

impl Object[src]

pub fn id(&self) -> u32[src]

Get the object id, unique across all objects.

pub fn x(&self) -> f64[src]

Horizontal position.

pub fn y(&self) -> f64[src]

Vertical position.

pub fn gid(&self) -> Option<u32>[src]

Get object gid if it represents a tile.

pub fn name(&self) -> &String[src]

Get the name of the object.

pub fn obj_type(&self) -> &String[src]

Get the user-defined type of the object.

pub fn height(&self) -> f64[src]

Height of the object

pub fn width(&self) -> f64[src]

Width of the object.

pub fn rotation(&self) -> f64[src]

Get the rotation of the object.

pub fn visible(&self) -> bool[src]

Is the object visible in Tiled.

pub fn is_ellipse(&self) -> bool[src]

Does the object describe an ellipse?

pub fn is_point(&self) -> bool[src]

Does the object describe a point?

pub fn is_polygon(&self) -> bool[src]

Does the object describe a polygon?

pub fn is_polyline(&self) -> bool[src]

Does the object describe a polyline?

pub fn is_text(&self) -> bool[src]

Does the object describe text?

pub fn polygon(&self) -> Option<&Vec<Point>>[src]

Get a reference to the polygon vector of points.

pub fn polyline(&self) -> Option<&Vec<Point>>[src]

Gets a reference of the polyline vector of points.

pub fn text(&self) -> Option<&Text>[src]

Gets a reference to the Text data of the object.

Trait Implementations

impl Debug for Object[src]

impl<'de> Deserialize<'de> for Object[src]

impl HasProperty for Object[src]

fn get_property_vector(&self) -> &Vec<Property>[src]

Access properties of Objects.

Auto Trait Implementations

impl RefUnwindSafe for Object

impl Send for Object

impl Sync for Object

impl Unpin for Object

impl UnwindSafe for Object

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.