[−][src]Struct ogmo3::level::Level
An Ogmo level.
Fields
width: f32
The width of the level.
height: f32
The height of the level.
offset_x: f32
The offset of the level on the X axis. Useful for loading multiple chunked levels.
offset_y: f32
The offset of the level on the Y axis. Useful for loading multiple chunked levels.
layers: Vec<Layer>
The layers that make up the level.
values: HashMap<String, Value>
The level's custom values.
Implementations
impl Level
[src]
pub fn from_json(s: &str) -> Result<Level, Error>
[src]
Parses an Ogmo level from a JSON string.
Errors
Error::Json
will be returned if deserialization fails.
pub fn from_file(path: impl AsRef<Path>) -> Result<Level, Error>
[src]
Parses an Ogmo level from a file.
Errors
Error::Io
will be returned if the file cannot be read.Error::Json
will be returned if deserialization fails.
Trait Implementations
impl Clone for Level
[src]
impl Debug for Level
[src]
impl<'de> Deserialize<'de> for Level
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for Level
impl Send for Level
impl Sync for Level
impl Unpin for Level
impl UnwindSafe for Level
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,