Skip to content

Commit

Permalink
Expose more of the LDTK schema
Browse files Browse the repository at this point in the history
  • Loading branch information
17cupsofcoffee committed Jan 10, 2024
1 parent 0ab3f22 commit fb57634
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ldtk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ pub struct Level {

pub iid: String,

#[serde(rename = "pxWid")]
pub width: i32,

#[serde(rename = "pxHei")]
pub height: i32,

#[serde(default = "Vec::new")]
pub layer_instances: Vec<LayerInstance>,
}
Expand Down Expand Up @@ -127,7 +133,9 @@ pub struct LayerInstance {

pub entity_instances: Vec<EntityInstance>,

pub grid_tiles: Vec<GridTile>,
pub grid_tiles: Vec<Tile>,

pub auto_layer_tiles: Vec<Tile>,

pub int_grid_csv: Vec<i32>,
}
Expand Down Expand Up @@ -157,7 +165,7 @@ impl LayerInstance {

#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GridTile {
pub struct Tile {
#[serde(rename = "t")]
pub id: i32,

Expand Down

0 comments on commit fb57634

Please sign in to comment.