private void filmRollToolStripMenuItem_Click(object sender, EventArgs e) { if (filmRoll == null) { filmRoll = new Film_Roll(this); } filmRoll.Show(); }
public HitBoxEditor() { InitializeComponent(); currentFrame = 0; curX = 0; curY = 0; mouseX = 0; mouseY = 0; scaleX = 1; scaleY = 1; resizing = 0; saveFilePath = ""; filmRoll = null; storedHitbox = null; displayGrid = true; stopAnimation = false; summaryBox = new Summary(); drawOffSet = new Vector2(0, 0); drawVelocity = new Vector2(0, 0); playAnimationTimer = new System.Windows.Forms.Timer(); }
private void HitBoxEditor_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete) { var result = player.sprites[currentFrame].hitBoxes.SingleOrDefault(i => i.selected == true); player.sprites[currentFrame].hitBoxes.Remove(result); MainGraphicPanel.Invalidate(); } if (e.Modifiers == Keys.Control && e.KeyCode == Keys.R) { if (filmRoll == null) { filmRoll = new Film_Roll(this); } if (!filmRoll.Visible) { filmRoll.Show(); } else { filmRoll.Hide(); } } if (e.Modifiers == Keys.Control && e.KeyCode == Keys.F) { if (summaryBox == null) { summaryBox = new Summary(this); } if (!summaryBox.Visible) { summaryBox.Show(); } else { summaryBox.Hide(); } } if (e.Modifiers == Keys.Control && e.KeyCode == Keys.C) { foreach (var hb in player.sprites[currentFrame].hitBoxes) { var p = MainGraphicPanel.PointToClient(new Point(mouseX, mouseY)); if (hb.selected) { storedHitbox = hb; } } } if (e.Modifiers == Keys.Control && e.KeyCode == Keys.V) { if (storedHitbox != null) { player.sprites[currentFrame].hitBoxes.ForEach(n => n.selected = false); var hit = new HitBox(); hit.x = storedHitbox.x; hit.y = storedHitbox.y; hit.xx = storedHitbox.xx; hit.yy = storedHitbox.yy; hit.type = storedHitbox.type; hit.xoff = storedHitbox.xoff; hit.yoff = storedHitbox.yoff; hit.selected = true; player.sprites[currentFrame].hitBoxes.Add(hit); MainGraphicPanel.Invalidate(); } } if (tool == ToolType.Move) { if (e.KeyCode == Keys.Left) { if (curX > 0) { curX--; } } } }