public override void MouseMove(int mx, int my, int dx, int dy) { if (DragOn) { CamX -= dx; CamY -= dy; } if (RotOn) { CamRotation += dx; } //Console.WriteLine("MX:" + mx + " MY:" + my + " DX:" + dx + " DY:" + dy); var hit = GGraph.Pick(mx, my); if (hit != null) { //Console.WriteLine("Hit. X:" + hit.X + " Y:" + hit.Y); if (hit is TrinityEngine.Graph.GraphMapHit) { var hm = hit as TrinityEngine.Graph.GraphMapHit; TileHit = hm; hm.Map.ClearHighlights(); hm.Map.HighlightTile(hm.TileX, hm.TileY); //Console.WriteLine("Yep"); } } if (PlotOn) { if (TileHit != null) { if (TrinityEditor.Controls.Selector.TileSelector.ActiveTile != null) { TileHit.Map.Layers[0].SetTile(TileHit.TileX, TileHit.TileY, TrinityEditor.Controls.Selector.TileSelector.ActiveTile); } } } //ase.MouseMove(mx, my, dx, dy); //CamX = CamX + dx; //CamY = CamY + dy; }
private void View_MouseMove(object sender, MouseEventArgs e) { if (firstM) { lastMx = e.X; lastMy = e.Y; firstM = false; } if (DragOn) { TileMap.CamX -= (e.X - lastMx); TileMap.CamY -= (e.Y - lastMy); //MouseMove(e.X, e.Y, e.X - lastMx, e.Y - lastMy); } else { var hit = TileMap.Pick(e.X, e.Y); p_hit = null; if (hit != null) { //Console.WriteLine("Hit. X:" + hit.X + " Y:" + hit.Y); if (hit is TrinityEngine.Graph.GraphMapHit) { var hm = hit as TrinityEngine.Graph.GraphMapHit; hm.Map.ClearHighlights(); hm.Map.HighlightTile(hm.TileX, hm.TileY); //Console.WriteLine("Yep"); p_hit = hm; } } } lastMx = e.X; lastMy = e.Y; View.Invalidate(); //throw new NotImplementedException(); }