Struct ldtk2::TileInstance
source · [−]pub struct TileInstance {
pub d: Vec<i64>,
pub f: i64,
pub px: Vec<i64>,
pub src: Vec<i64>,
pub t: i64,
}
Expand description
This structure represents a single tile from a given Tileset.
Fields
d: Vec<i64>
Internal data used by the editor.
For auto-layer tiles: [ruleId, coordId]
.
For tile-layer tiles: [coordId]
.
f: i64
“Flip bits”, a 2-bits integer to represent the mirror transformations of the tile.
- Bit 0 = X flip
- Bit 1 = Y flip
Examples: f=0 (no flip), f=1 (X flip only), f=2 (Y flip only), f=3 (both flips)
px: Vec<i64>
Pixel coordinates of the tile in the layer ([x,y]
format). Don’t forget optional
layer offsets, if they exist!
src: Vec<i64>
Pixel coordinates of the tile in the tileset ([x,y]
format)
t: i64
The Tile ID in the corresponding tileset.
Trait Implementations
sourceimpl Clone for TileInstance
impl Clone for TileInstance
sourcefn clone(&self) -> TileInstance
fn clone(&self) -> TileInstance
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TileInstance
impl Debug for TileInstance
sourceimpl<'de> Deserialize<'de> for TileInstance
impl<'de> Deserialize<'de> for TileInstance
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for TileInstance
impl Serialize for TileInstance
Auto Trait Implementations
impl RefUnwindSafe for TileInstance
impl Send for TileInstance
impl Sync for TileInstance
impl Unpin for TileInstance
impl UnwindSafe for TileInstance
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more