コード例 #1
0
ファイル: Form1.cs プロジェクト: gmoller/MapEditor
 private void Player2_UnitMoved(object sender, UnitMovedEventArgs e)
 {
     _mapWindow.DrawUnit(e.Unit, "#", Font);
     _mapWindow.FlipBuffer();
 }
コード例 #2
0
        /// <summary>
        /// Trigger function in the event of unit moving across the screen
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void updateLocationOfUnit(Object sender, UnitMovedEventArgs e)
        {
            UnitUI ui = componentToUI[e.Unit] as UnitUI;

            ui.DrawBox = new Rectangle((int)(e.NewPoint.X * cellDimension) - ui.DrawBox.Width / 2, (int)(e.NewPoint.Y * cellDimension) - ui.DrawBox.Height / 2, ui.DrawBox.Width, ui.DrawBox.Height);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: gmoller/MapEditor
        private void Player_UnitMoved(object sender, UnitMovedEventArgs e)
        {
            Point cell = new Point(Globals.Instance.GameWorld.SelectedUnit.Location.X, Globals.Instance.GameWorld.SelectedUnit.Location.Y);

            _mapWindow.CenterOnCell(cell);
        }