You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/release-notes.txt
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -41,4 +41,8 @@
41
41
- Resolved issue where MonoGame.Aseprite.dll assembly reference was required for the MonoGame.Aseprite.Content.Pipeline.dll assembly in the mgcb-editor (Closes #76)
42
42
- `TextureRegion.TryGetSlice` and `TextureRegion.TryGetSlice<T>` methods added (credit: @fdrobidoux)
43
43
44
+
## 5.1.0
45
+
- `AsepriteCel` properties were made public (thanks @SephDB)
46
+
- `AnimatedSprite` now supports setting frame both on initial play and during playback.
- Resolved issue where MonoGame.Aseprite.dll assembly reference was required for the MonoGame.Aseprite.Content.Pipeline.dll assembly in the mgcb-editor (Closes #76)
44
-
- `TextureRegion.TryGetSlice` and `TextureRegion.TryGetSlice<T>` methods added (credit: @fdrobidoux)
43
+
- `AsepriteCel` properties were made public (thanks @SephDB)
44
+
- `AnimatedSprite` now supports setting frame both on initial play and during playback.
45
45
</PackageReleaseNotes>
46
46
<Description>
47
47
MonoGame.Aseprite.Content.Pipeline is a cross-platform C# library that adds an extension to the MonoGame
- Resolved issue where MonoGame.Aseprite.dll assembly reference was required for the MonoGame.Aseprite.Content.Pipeline.dll assembly in the mgcb-editor (Closes #76)
35
-
- `TextureRegion.TryGetSlice` and `TextureRegion.TryGetSlice<T>` methods added (credit: @fdrobidoux)
34
+
- `AsepriteCel` properties were made public (thanks @SephDB)
35
+
- `AnimatedSprite` now supports setting frame both on initial play and during playback.
36
36
</PackageReleaseNotes>
37
37
<Description>
38
38
MonoGame.Aseprite is a cross-platofrm C# library that adds support to MonoGame projects for
/// Thrown if the <paramref name="frameIndex"/> value provided is less than zero or is greater than or equal to
219
+
/// the total number of frames in this <see cref="AnimatedSprite"/>.
220
+
/// </exception>
221
+
publicvoidSetFrame(intframeIndex)
222
+
{
223
+
if(frameIndex<0||frameIndex>=FrameCount)
224
+
{
225
+
thrownewArgumentOutOfRangeException(nameof(frameIndex),$"{nameof(frameIndex)} must be greater than zero and less than the total number of frames in this AnimatedSprite");
thrownewArgumentOutOfRangeException(nameof(startingFrame),$"{nameof(startingFrame)} must be greater than zero and less than the total number of frames in this AnimatedSprite");
320
+
}
321
+
277
322
// Cannot play something that's already playing
278
323
if(IsAnimating)
279
324
{
@@ -291,14 +336,15 @@ public bool Play(int? loopCount = default)
291
336
IsAnimating=true;
292
337
IsPaused=false;
293
338
294
-
_currentIndex=0;
339
+
_currentIndex=startingFrame??0;
295
340
296
341
if(IsReversed)
297
342
{
298
343
_currentIndex=_animationTag.Frames.Length-1;
299
344
}
300
345
301
346
TextureRegion=CurrentFrame.TextureRegion;
347
+
CurrentFrameTimeRemaining=CurrentFrame.Duration;
302
348
_hasBegun=false;
303
349
304
350
returntrue;
@@ -398,8 +444,8 @@ public bool Stop()
398
444
399
445
/// <summary>
400
446
/// Resets this <see cref="AnimatedSprite"/> back to its initial state as defined by the
401
-
/// <see cref="AnimationTag"/> used to create it. You will need to call <see cref="AnimatedSprite.Play(int?)"/>
402
-
/// after resetting to start the playback of the animation.s
447
+
/// <see cref="AnimationTag"/> used to create it. You will need to call <see cref="AnimatedSprite.Play(int?, int?)"/>
448
+
/// after resetting to start the playback of the animation.
0 commit comments