[−][src]Struct rs_tiled_json::tileset::Tile
Tile contains data relevant to overrides of the tileset. This is for containing data specific to certain tiles within the tileset, such animations, collisions, different images, and properties.
This struct implements the trait HasProperty, which enables easy access of Tiled properties for Tiles. The relevant functions are:
tiled_json::Tile::get_property(&self, name: &str) -> Option<&tiled_json::Property>; tiled_json::Tile::get_property_vector(&self) -> &Vec<tiled_json::Property>; tiled_json::Tile::get_property_value(&self, name: &str) -> Option<&tiled_json::PropertyValue>; // See the tiled_json::Property struct to see functionality offered.
Fields
id: u16
image: Option<String>
imageheight: u16
imagewidth: u16
ttype: Option<String>
objectgroup: Option<Layer>
animation: Vec<Frame>
properties: Vec<Property>
Methods
impl Tile
[src]
pub fn get_anim(&self, msecs: u32) -> (bool, u16)
[src]
This will get you the tileid of the animation frame at msecs (milliseconds) from creation.
The tuple is a boolean (whether we get an animation or not) and a u16, which will be the local id of the tile in the parent tileset.
pub fn id(&self) -> u16
[src]
id refers to the local id of the tile in the tileset. This is dissimilar to the gid (global id) used for storing data in tile layers.
pub fn image_height(&self) -> u16
[src]
Take the image height in pixels. If this was unspecified in Tiled, this data will be 0.
pub fn image_width(&self) -> u16
[src]
Take the image width in pixels. If this was unspecified in Tiled, this data will be 0.
pub fn animation(&self) -> &Vec<Frame>
[src]
Access the animation data. This vector can be empty.
pub fn image(&self) -> Option<&String>
[src]
Get the filename of the image this refers to.
pub fn get_type(&self) -> Option<&String>
[src]
User specified type of tile.
pub fn object_group(&self) -> Option<&Layer>
[src]
This will give you the objectgroup layer. This is for determining collisions as defined in the tileset.
Trait Implementations
impl Debug for Tile
[src]
impl<'de> Deserialize<'de> for Tile
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl HasProperty for Tile
[src]
fn get_property_vector(&self) -> &Vec<Property>
[src]
Get access to the properties of the Tile object.
fn get_property(&self, name: &str) -> Option<&Property>
[src]
fn get_property_value(&self, name: &str) -> Option<&PropertyValue>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Tile
impl Send for Tile
impl Sync for Tile
impl Unpin for Tile
impl UnwindSafe for Tile
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,