public void MouseDown(MouseEventArgs mouseData) { switch (mouseData.Button) { case MouseButtons.Left: _writing = true; _currentTextPolygons = new List <Polygon>(); LevEditor.RedrawScene(); var result = TextToolForm.ShowDefault(_currentOptions, HandleChange); _writing = false; if (result.HasValue) { _currentOptions = result.Value; MarkAllAs(VectorMark.None); var rendered = RenderString(_currentOptions, CurrentPos); Lev.Polygons.AddRange(rendered); if (rendered.Count > 0) { LevEditor.Modified = true; } LevEditor.UpdateSelectionInfo(); } LevEditor.RedrawScene(); break; case MouseButtons.None: break; case MouseButtons.Right: break; case MouseButtons.Middle: break; case MouseButtons.XButton1: break; case MouseButtons.XButton2: break; default: throw new ArgumentOutOfRangeException(); } }
private void HandleChange(TextToolOptions obj) { _currentTextPolygons = RenderString(obj, CurrentPos); LevEditor.RedrawScene(); }