Skip to content

Commit

Permalink
Update samples for AsepriteDotNet 1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AristurtleDev committed Sep 27, 2024
1 parent 290197f commit a5a750b
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/AnimatedTilemapExample/Game1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected override void LoadContent()
/// Create an animated tilemap from the file based on all frames.
///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
_animatedTilemap = aseFile.CreateAnimatedTilemap(GraphicsDevice);
_animatedTilemap = aseFile.CreateAnimatedTilemap(GraphicsDevice, onlyVisibleLayers: true);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
Expand Down
13 changes: 12 additions & 1 deletion examples/ContentPipelineExample/Game1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,19 @@ protected override void LoadContent()
///
/// Do something with i (see the other examples for more information
///
/// The onlyVisibleLayers, includeBackgroundLayer, includeTilemapLayers, mergeDuplicateLayers, borderPadding,
/// spacing, and innerPadding parameters used below are optional. Their default values are shown.
///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
SpriteSheet sheet = aseFile.CreateSpriteSheet(GraphicsDevice);
SpriteSheet sheet = aseFile.CreateSpriteSheet(GraphicsDevice,
onlyVisibleLayers: true,
includeBackgroundLayer: false,
includeTilemapLayers: false,
mergeDuplicateFrames: true,
borderPadding: 0,
spacing: 0,
innerPadding: 0);

_animatedSprite = sheet.CreateAnimatedSprite("walk");
_animatedSprite.Play();
}
Expand Down
9 changes: 8 additions & 1 deletion examples/SpriteExample/Game1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,15 @@ protected override void LoadContent()
///
/// Create a sprite from any frame in the aseprite file
///
/// The onlyVisibleLayers, includeBackgroundLayer, includeTilemapLayers, parameters used below are optional.
/// Their default values are shown.
///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
_sprite = aseFile.CreateSprite(GraphicsDevice, 0);
_sprite = aseFile.CreateSprite(GraphicsDevice,
0,
onlyVisibleLayers: true,
includeBackgroundLayer: false,
includeTilemapLayers: false);
}

protected override void Draw(GameTime gameTime)
Expand Down
12 changes: 11 additions & 1 deletion examples/SpritesheetExample/Game1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,18 @@ protected override void LoadContent()
///
/// Create a sprite sheet from any frame in the aseprite file
///
/// The onlyVisibleLayers, includeBackgroundLayer, includeTilemapLayers, mergeDuplicateLayers, borderPadding,
/// spacing, and innerPadding parameters used below are optional. Their default values are shown.
///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
_spriteSheet = aseFile.CreateSpriteSheet(GraphicsDevice);
_spriteSheet = aseFile.CreateSpriteSheet(GraphicsDevice,
onlyVisibleLayers: true,
includeBackgroundLayer: false,
includeTilemapLayers: false,
mergeDuplicateFrames: true,
borderPadding: 0,
spacing: 0,
innerPadding: 0);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
Expand Down
12 changes: 11 additions & 1 deletion examples/TextureAtlasExample/Game1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,18 @@ protected override void LoadContent()
///
/// Create a texture atlas from the aseprite file
///
/// The onlyVisibleLayers, includeBackgroundLayer, includeTilemapLayers, mergeDuplicateLayers, borderPadding,
/// spacing, and innerPadding parameters used below are optional. Their default values are shown.
///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
_atlas = aseFile.CreateTextureAtlas(GraphicsDevice);
_atlas = aseFile.CreateTextureAtlas(GraphicsDevice,
onlyVisibleLayers: true,
includeBackgroundLayer: false,
includeTilemapLayers: false,
mergeDuplicateFrames: true,
borderPadding: 0,
spacing: 0,
innerPadding: 0);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
Expand Down
4 changes: 3 additions & 1 deletion examples/TilemapExample/Game1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ protected override void LoadContent()
///
/// Create a tilemap from the file based on the frame the tilemap is on.
///
/// The onlyVisibleLayers parameter is optional. It's default value is shown
///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
_tilemap = aseFile.CreateTilemap(GraphicsDevice, frameIndex: 0);
_tilemap = aseFile.CreateTilemap(GraphicsDevice, frameIndex: 0, onlyVisibleLayers: true);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
Expand Down

0 comments on commit a5a750b

Please sign in to comment.