コード例 #1
0
 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);
 }
コード例 #2
0
 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;
 }