Set up an initial spriteinfo

This commit is contained in:
2017-09-16 19:08:46 -05:00
parent 7e22a57ca5
commit c438320a5e
2 changed files with 268 additions and 34 deletions

View File

@ -21,6 +21,7 @@ namespace SpriteLibrary
SpriteController MyController;
ResourceManager myResources = null;
List<SpriteInfo> SpriteInformation = new List<SpriteInfo>();
SpriteInfo TempInformation = null;
Size SnapGridSize = new Size(5,5);
SpriteDatabase myDatabase = null;
int CurrentSIIndex = -1; //The information item we are editing. -1 means it is a new one.
@ -40,6 +41,7 @@ namespace SpriteLibrary
{
pbImageField.BackgroundImageLayout = ImageLayout.Stretch;
MyController = new SpriteController(pbImageField);
UpdateMenu();
PopulateMenu();
}
@ -72,6 +74,27 @@ namespace SpriteLibrary
cbStartingImage.SelectedIndex = 0;
}
private void UpdateMenu()
{
lblCountSprites.Text = SpriteInformation.Count.ToString();
if (TempInformation == null) SetUpEmptyInfo();
}
private void SetUpEmptyInfo()
{
TempInformation = new SpriteInfo();
TempInformation.SpriteName = "";
TempInformation.ViewPercent = 100;
AnimationInfo AI = new AnimationInfo();
AI.AnimSpeed = 200;
AI.FieldsToUse = AnimationType.SpriteDefinition;
AI.Height = 100;
AI.Width = 100;
AI.StartPoint = new Point(0, 0);
AI.ViewPercent = 100;
TempInformation.Animations.Add(AI);
}
private void cbStartingImage_SelectedIndexChanged(object sender, EventArgs e)
{
ResourceManager rm;