[][src]Struct ogmo3::project::Project

pub struct Project {
    pub name: String,
    pub ogmo_version: String,
    pub level_paths: Vec<PathBuf>,
    pub background_color: String,
    pub grid_color: String,
    pub angles_radians: bool,
    pub directory_depth: i32,
    pub layer_grid_default_size: Vec2<i32>,
    pub level_default_size: Vec2<i32>,
    pub level_min_size: Vec2<i32>,
    pub level_max_size: Vec2<i32>,
    pub level_values: Vec<ValueTemplate>,
    pub default_export_mode: String,
    pub compact_export: bool,
    pub entity_tags: Vec<String>,
    pub layers: Vec<LayerTemplate>,
    pub entities: Vec<EntityTemplate>,
    pub tilesets: Vec<Tileset>,
}

An Ogmo project.

Fields

name: String

The name of the Ogmo project.

ogmo_version: String

The version of Ogmo used to export this project.

level_paths: Vec<PathBuf>

An array of paths that hold the project's levels.

background_color: String

The project's background color.

grid_color: String

The color of the grid displayed in the editor.

angles_radians: bool

Whether the project describes angles in radians or degrees.

directory_depth: i32

The maximum depth that the editor will search for levels in its file tree.

layer_grid_default_size: Vec2<i32>

The default grid size for newly created layers.

level_default_size: Vec2<i32>

The default size of newly created levels in the editor.

level_min_size: Vec2<i32>

The minimum size of a level.

level_max_size: Vec2<i32>

The maximum size of a level.

level_values: Vec<ValueTemplate>

The value templates for the project's levels.

default_export_mode: String

The default exported file type of a level.

compact_export: bool

Whether the project's files will be exported from the editor in a compact format.

entity_tags: Vec<String>

The tags that can be attached to entities.

layers: Vec<LayerTemplate>

The project's layer templates.

entities: Vec<EntityTemplate>

The project's entity templates.

tilesets: Vec<Tileset>

The project's tilesets.

Implementations

impl Project[src]

pub fn from_json(s: &str) -> Result<Project, Error>[src]

Parses an Ogmo project from a JSON string.

Errors

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

pub fn from_file(path: impl AsRef<Path>) -> Result<Project, Error>[src]

Parses an Ogmo project from a file.

Errors

  • Error::Io will be returned if the file cannot be read.
  • Error::Json will be returned if deserialization fails.

pub fn to_json(&self) -> Result<String, Error>[src]

Writes the Ogmo project to a JSON string.

Errors

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

pub fn to_json_pretty(&self) -> Result<String, Error>[src]

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

Errors

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

Trait Implementations

impl Clone for Project[src]

impl Debug for Project[src]

impl<'de> Deserialize<'de> for Project[src]

impl Serialize for Project[src]

Auto Trait Implementations

impl RefUnwindSafe for Project

impl Send for Project

impl Sync for Project

impl Unpin for Project

impl UnwindSafe for Project

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.