Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Commit ebee2bc

Browse files
authored
Dev (#4)
* Lil update again * Remove dependency * Just uploading very little changes Co-authored-by: Chamalow Mellow <49991411+chamalowmoelleux@users.noreply.github.com>
1 parent 41a5290 commit ebee2bc

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

Example/Example.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@
2525
</ItemGroup>
2626
<ItemGroup>
2727
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641" />
28+
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
2829
</ItemGroup>
2930
<ItemGroup>
3031
<ProjectReference Include="..\MonoGame LDtk Importer\MonoGame LDtk Importer.csproj" />
3132
</ItemGroup>
33+
<ItemGroup>
34+
<Content Include="Content\**">
35+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
36+
</Content>
37+
</ItemGroup>
3238
</Project>

Example/Game1.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ protected override void Initialize()
7979
protected override void LoadContent()
8080
{
8181
_spriteBatch = new SpriteBatch(GraphicsDevice);
82-
project = new LDtkProject(@"C:\Users\Boubli\Documents\GitHub\MonoGame-LDtk-Importer\Example\Content\Typical_TopDown_example.ldtk");
83-
project2 = new LDtkProject(@"C:\Users\Cookky\Documents\GitHub\MonoGame-LDtk-Importer\Example\Content\FieldsTypes.ldtk");
84-
project3 = new LDtkProject(@"C:\Users\Cookky\Documents\GitHub\MonoGame-LDtk-Importer\Example\Content\SeparateLevelFiles.ldtk");
82+
83+
project = new LDtkProject(@"Content\Test_file_for_API_showing_all_features.ldtk");
84+
project2 = new LDtkProject(@"Content\FieldsTypes.ldtk");
85+
project3 = new LDtkProject(@"Content\SeparateLevelFiles.ldtk");
8586
font = Content.Load<SpriteFont>("font");
8687

8788
//project

MonoGame LDtk Importer/LDtkProject.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class LDtkProject
2626

2727
/// <summary>
2828
/// All levels. The order of this array is only relevant in LinearHorizontal and
29-
/// linearVertical world layouts (see worldLayout value).
29+
/// linearVertical world layouts (see worldLayout value).<br/>
3030
/// Otherwise, you should refer to the worldX, worldY coordinates of each Level.
3131
/// </summary>
3232
public List<Level> Levels { get; set; }
@@ -39,7 +39,7 @@ public class LDtkProject
3939
/// </summary>
4040
public int WorldGridWidth { get; set; }
4141
/// <summary>
42-
/// An enum that describes how levels are organized in this project (ie. linearly or in a 2D space).
42+
/// An enum that describes how levels are organized in this project (ie. linearly or in a 2D space).<br/>
4343
/// Possible values are: Free, GridVania, LinearHorizontal and LinearVertical.
4444
/// </summary>
4545
public WorldLayoutTypes WorldLayout { get; set; }
@@ -214,17 +214,14 @@ public static List<Level> LoadLevels(JsonProperty jsonProperty, bool levelsAreEx
214214
{
215215
if (property.Value.ValueKind != JsonValueKind.Null)
216216
{
217-
if (property.Name == "_bgcolor")
217+
if (property.Name == "__bgColor")
218218
{
219-
level.BackgroundColor = new Color(
220-
System.Drawing.ColorTranslator.FromHtml(property.Value.GetString()).R,
221-
System.Drawing.ColorTranslator.FromHtml(property.Value.GetString()).G,
222-
System.Drawing.ColorTranslator.FromHtml(property.Value.GetString()).B
223-
);
219+
System.Drawing.Color color = System.Drawing.ColorTranslator.FromHtml(property.Value.GetString());
220+
level.BackgroundColor = new Color(color.R, color.G, color.B, color.A);
224221
}
225222
if (property.Name == "__bgPos")
226223
{
227-
level.BackgroundPosition = MonoGame_LDtk_Importer.BackgroundPosition.LoadBackgroundPos(property);
224+
level.BackgroundPosition = BackgroundPosition.LoadBackgroundPos(property);
228225
}
229226
else if (property.Name == "__neighbours")
230227
{

MonoGame LDtk Importer/MonoGame LDtk Importer.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
<Authors>chamalowmoelleux</Authors>
99
<Product>MonoGame LDtk Importer</Product>
1010
<PackageId>Monogame-LDtk-Importer</PackageId>
11-
<PackageVersion>2.0.0</PackageVersion>
11+
<PackageVersion>2.0.1</PackageVersion>
1212
<Description>Monogame importer for the LDtk app by Deepnight</Description>
1313
<PackageProjectUrl>https://github.com/chamalowmoelleux/MonoGame-LDtk-Importer/</PackageProjectUrl>
1414
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1515
<RepositoryUrl>https://github.com/chamalowmoelleux/MonoGame-LDtk-Importer/</RepositoryUrl>
1616
<PackageTags>LDtk, Monogame, Level-Editor</PackageTags>
1717
<RepositoryType>git</RepositoryType>
18-
<PackageReleaseNotes>Removed support for MonoGame Pipeline. Added some useful methods.</PackageReleaseNotes>
18+
<PackageReleaseNotes>Bug fixes and other littles things.</PackageReleaseNotes>
1919
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2020
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2121
<AssemblyName>MonoGame LDtk Importer</AssemblyName>

0 commit comments

Comments
 (0)