Preview animations fwd/back buttons working
This commit is contained in:
parent
8067b91759
commit
fb0771a474
2
SpriteLibrary/SpriteEntryForm.Designer.cs
generated
2
SpriteLibrary/SpriteEntryForm.Designer.cs
generated
@ -471,6 +471,7 @@
|
||||
this.btnPreviewAnimFwd.TabIndex = 25;
|
||||
this.btnPreviewAnimFwd.Text = ">";
|
||||
this.btnPreviewAnimFwd.UseVisualStyleBackColor = true;
|
||||
this.btnPreviewAnimFwd.Click += new System.EventHandler(this.btnPreviewAnimFwd_Click);
|
||||
//
|
||||
// btnPreviewAnimBack
|
||||
//
|
||||
@ -481,6 +482,7 @@
|
||||
this.btnPreviewAnimBack.TabIndex = 26;
|
||||
this.btnPreviewAnimBack.Text = "<";
|
||||
this.btnPreviewAnimBack.UseVisualStyleBackColor = true;
|
||||
this.btnPreviewAnimBack.Click += new System.EventHandler(this.btnPreviewAnimBack_Click);
|
||||
//
|
||||
// SpriteEntryForm
|
||||
//
|
||||
|
@ -452,5 +452,27 @@ namespace SpriteLibrary
|
||||
PreviewSprite.PutBaseImageLocation(new Point(1, 1));
|
||||
//PreviewSprite.SetSize(new Size(50, 50));
|
||||
}
|
||||
|
||||
private void btnPreviewAnimBack_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(PreviewSprite != null)
|
||||
{
|
||||
int Animations = PreviewSprite.AnimationCount;
|
||||
int NextAnim = PreviewSprite.AnimationIndex - 1;
|
||||
if (NextAnim < 0) NextAnim = Animations - 1;
|
||||
PreviewSprite.ChangeAnimation(NextAnim);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnPreviewAnimFwd_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (PreviewSprite != null)
|
||||
{
|
||||
int Animations = PreviewSprite.AnimationCount;
|
||||
int NextAnim = PreviewSprite.AnimationIndex + 1;
|
||||
if (NextAnim >= Animations) NextAnim = 0;
|
||||
PreviewSprite.ChangeAnimation(NextAnim);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user