Skip to content

Commit a5a750b

Browse files
committed
Update samples for AsepriteDotNet 1.9.0
1 parent 290197f commit a5a750b

File tree

6 files changed

+46
-6
lines changed

6 files changed

+46
-6
lines changed

examples/AnimatedTilemapExample/Game1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected override void LoadContent()
4747
/// Create an animated tilemap from the file based on all frames.
4848
///
4949
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
50-
_animatedTilemap = aseFile.CreateAnimatedTilemap(GraphicsDevice);
50+
_animatedTilemap = aseFile.CreateAnimatedTilemap(GraphicsDevice, onlyVisibleLayers: true);
5151

5252
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
5353
///

examples/ContentPipelineExample/Game1.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,19 @@ protected override void LoadContent()
3737
///
3838
/// Do something with i (see the other examples for more information
3939
///
40+
/// The onlyVisibleLayers, includeBackgroundLayer, includeTilemapLayers, mergeDuplicateLayers, borderPadding,
41+
/// spacing, and innerPadding parameters used below are optional. Their default values are shown.
42+
///
4043
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
41-
SpriteSheet sheet = aseFile.CreateSpriteSheet(GraphicsDevice);
44+
SpriteSheet sheet = aseFile.CreateSpriteSheet(GraphicsDevice,
45+
onlyVisibleLayers: true,
46+
includeBackgroundLayer: false,
47+
includeTilemapLayers: false,
48+
mergeDuplicateFrames: true,
49+
borderPadding: 0,
50+
spacing: 0,
51+
innerPadding: 0);
52+
4253
_animatedSprite = sheet.CreateAnimatedSprite("walk");
4354
_animatedSprite.Play();
4455
}

examples/SpriteExample/Game1.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,15 @@ protected override void LoadContent()
4848
///
4949
/// Create a sprite from any frame in the aseprite file
5050
///
51+
/// The onlyVisibleLayers, includeBackgroundLayer, includeTilemapLayers, parameters used below are optional.
52+
/// Their default values are shown.
53+
///
5154
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
52-
_sprite = aseFile.CreateSprite(GraphicsDevice, 0);
55+
_sprite = aseFile.CreateSprite(GraphicsDevice,
56+
0,
57+
onlyVisibleLayers: true,
58+
includeBackgroundLayer: false,
59+
includeTilemapLayers: false);
5360
}
5461

5562
protected override void Draw(GameTime gameTime)

examples/SpritesheetExample/Game1.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,18 @@ protected override void LoadContent()
5151
///
5252
/// Create a sprite sheet from any frame in the aseprite file
5353
///
54+
/// The onlyVisibleLayers, includeBackgroundLayer, includeTilemapLayers, mergeDuplicateLayers, borderPadding,
55+
/// spacing, and innerPadding parameters used below are optional. Their default values are shown.
56+
///
5457
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
55-
_spriteSheet = aseFile.CreateSpriteSheet(GraphicsDevice);
58+
_spriteSheet = aseFile.CreateSpriteSheet(GraphicsDevice,
59+
onlyVisibleLayers: true,
60+
includeBackgroundLayer: false,
61+
includeTilemapLayers: false,
62+
mergeDuplicateFrames: true,
63+
borderPadding: 0,
64+
spacing: 0,
65+
innerPadding: 0);
5666

5767
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
5868
///

examples/TextureAtlasExample/Game1.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,18 @@ protected override void LoadContent()
5151
///
5252
/// Create a texture atlas from the aseprite file
5353
///
54+
/// The onlyVisibleLayers, includeBackgroundLayer, includeTilemapLayers, mergeDuplicateLayers, borderPadding,
55+
/// spacing, and innerPadding parameters used below are optional. Their default values are shown.
56+
///
5457
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
55-
_atlas = aseFile.CreateTextureAtlas(GraphicsDevice);
58+
_atlas = aseFile.CreateTextureAtlas(GraphicsDevice,
59+
onlyVisibleLayers: true,
60+
includeBackgroundLayer: false,
61+
includeTilemapLayers: false,
62+
mergeDuplicateFrames: true,
63+
borderPadding: 0,
64+
spacing: 0,
65+
innerPadding: 0);
5666

5767
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
5868
///

examples/TilemapExample/Game1.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ protected override void LoadContent()
4545
///
4646
/// Create a tilemap from the file based on the frame the tilemap is on.
4747
///
48+
/// The onlyVisibleLayers parameter is optional. It's default value is shown
49+
///
4850
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
49-
_tilemap = aseFile.CreateTilemap(GraphicsDevice, frameIndex: 0);
51+
_tilemap = aseFile.CreateTilemap(GraphicsDevice, frameIndex: 0, onlyVisibleLayers: true);
5052

5153
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
5254
///

0 commit comments

Comments
 (0)