[−][src]Struct ldtk_rust::ldtk_file::LdtkFile
Fields
json_version: Stringdefault_pivot_x: f32default_pivot_y: f32default_grid_size: i32bg_color: Stringdefault_level_bg_color: Stringnext_uid: i32minify_json: boolexport_tiled: boolworld_layout: Stringworld_grid_width: i32world_grid_height: i32defs: Defslevels: Vec<Level>redraw: boolImplementations
impl LdtkFile[src]
pub fn new(f: String) -> Self[src]
Takes a path to an LDtk file and returns a rust struct of the parsed JSON. It will mirror the original JSON structure for the most part, but with CamelCase names converted to their idiomatic rust counterparts (for instance, "jsonVersion" will become "json_version").
Example
extern crate ldtk; fn main() { let file_path = "assets/AutoLayers_4_Advanced.ldtk".to_string(); let ldtk = LdtkFile::new(file_path); println!("First level pixel height is {}!", ldtk.levels[0].px_hei); }
Trait Implementations
impl Debug for LdtkFile[src]
impl<'de> Deserialize<'de> for LdtkFile[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for LdtkFile[src]
impl Send for LdtkFile[src]
impl Sync for LdtkFile[src]
impl Unpin for LdtkFile[src]
impl UnwindSafe for LdtkFile[src]
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,
pub 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.
pub 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>,