public void Update() { if (stopwatch.IsRunning) { double elapsed = stopwatch.Elapsed.TotalSeconds - lastTime; float oldZoom = Zoom; Zoom = Util.Approach(Zoom, targetZoom, (float)elapsed * ZOOM_SPEED); float scale = Zoom / oldZoom; lastTime = stopwatch.Elapsed.TotalSeconds; PointF at = ScreenToEditor(zoomAt); Matrix.Translate(at.X, at.Y); Matrix.Scale(scale, scale); Matrix.Translate(-at.X, -at.Y); UpdateInverse(); LevelEditor.Invalidate(); if (Zoom == targetZoom) { stopwatch.Stop(); } } }
public override void Paste(LevelEditor editor, Layer layer) { editor.StartBatch(); foreach (var e in entities) editor.BatchPerform(new EntityAddAction(layer as EntityLayer, e.Clone())); editor.EndBatch(); }
public LevelView(LevelEditor levelEditor) { LevelEditor = levelEditor; Matrix = new Matrix(); Inverse = new Matrix(); targetZoom = Zoom = 1; stopwatch = new Stopwatch(); Center(); }
private void onLevelAdded(int index) { TabPage t = new TabPage(Ogmo.Levels[index].Name); t.ImageIndex = 1; LevelEditor e = new LevelEditor(Ogmo.Levels[index]); LevelEditors.Add(e); t.Controls.Add(e); MasterTabControl.TabPages.Add(t); }
public override void Paste(LevelEditor editor, Layer layer) { editor.Perform(new TilePasteSelectionAction(layer as TileLayer, Area, Data)); }
public abstract LayerEditor GetEditor(LevelEditor editor);
public override void Paste(LevelEditor editor, Layer layer) { editor.Perform(new GridPasteSelectionAction(layer as GridLayer, Area, Bits)); }
public abstract void Paste(LevelEditor editor, Layer layer);