public AnimationSelector(SpriteSheet sheet, Project project) { InitializeComponent(); spriteSelector.Image = sheet.sheet; spriteSelector.SpriteWidth = sheet.spriteWidth; spriteSelector.SpriteHeight = sheet.spriteHeight; selectedFrames = new Animation.Frame[1]; selectedFrames[0] = new Animation.Frame(0, 1); }
private void maxFramesNumUpDown_ValueChanged(object sender, EventArgs e) { currentFrameNumUpDown.Maximum = maxFramesNumUpDown.Value; Animation.Frame[] newFrames = new Animation.Frame[(int)maxFramesNumUpDown.Value]; Array.Copy(selectedFrames, newFrames, (int)Math.Min(selectedFrames.Length, newFrames.Length)); Animation.Frame frame = selectedFrames[selectedFrames.Length - 1]; for (int i = selectedFrames.Length; i < newFrames.Length; ++i) { newFrames[i] = new Animation.Frame(frame.sheetId, frame.time); } selectedFrames = newFrames; }