Skip to content

Commit

Permalink
Added support for background color
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBoneJarmer committed Nov 1, 2021
1 parent f72e8e9 commit 850b876
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/TiledCS.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>2.4.1</Version>
<Version>2.4.2</Version>
<Authors>Ruben Labruyere</Authors>
<Company>Ruben Labruyere</Company>
<PackageId>TiledCS</PackageId>
Expand Down
11 changes: 10 additions & 1 deletion src/TiledMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ public class TiledMap
/// The tile height in pixels
/// </summary>
public int TileHeight { get; set; }

/// <summary>
/// Returns true if the map is configured as infinite
/// </summary>
public bool Infinite { get; set; }
/// <summary>
/// Returns the defined map background color as a hex string
/// </summary>
public string BackgroundColor { get; set; }
/// <summary>
/// Returns an empty instance of TiledMap
/// </summary>
Expand Down Expand Up @@ -128,6 +135,8 @@ public void ParseXml(string xml)
this.TiledVersion = nodeMap.Attributes["tiledversion"].Value;
this.Orientation = nodeMap.Attributes["orientation"].Value;
this.RenderOrder = nodeMap.Attributes["renderorder"].Value;
this.BackgroundColor = nodeMap.Attributes["backgroundcolor"]?.Value;
this.Infinite = nodeMap.Attributes["infinite"].Value == "1";

this.Width = int.Parse(nodeMap.Attributes["width"].Value);
this.Height = int.Parse(nodeMap.Attributes["height"].Value);
Expand Down

0 comments on commit 850b876

Please sign in to comment.