Struct ogmo3::level::Level[][src]

pub struct Level {
    pub ogmo_version: String,
    pub width: f32,
    pub height: f32,
    pub offset_x: f32,
    pub offset_y: f32,
    pub values: HashMap<String, Value>,
    pub layers: Vec<Layer>,
}
Expand description

An Ogmo level.

Fields

ogmo_version: String

The version of Ogmo used to export this level.

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.

values: HashMap<String, Value>

The level’s custom values.

layers: Vec<Layer>

The layers that make up the level.

Implementations

Parses an Ogmo level from a JSON string.

Errors

  • Error::Json will be returned if deserialization fails.

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.

Writes the Ogmo level to a JSON string.

Errors

  • Error::Json will be returned if serialization fails.

Writes the Ogmo level to a pretty-printed JSON string.

Errors

  • Error::Json will be returned if serialization fails.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.