コード例 #1
0
ファイル: TacticalMap.cs プロジェクト: dunvit/Outland-Area
        private void DrawTacticalMapScreen(IScreenInfo screenParameters, TacticalEnvironment environment)
        {
            DrawTacticalMap.DrawBackGround(screenParameters);

            DrawTacticalMap.DrawExplosions(screenParameters, environment);

            DrawTacticalMap.DrawWeaponAffectedArea(screenParameters, environment);

            DrawTacticalMap.DrawGrid(screenParameters);

            DrawTacticalMap.DrawRadar(screenParameters, environment);

            DrawTacticalMap.DrawAction(screenParameters, environment);

            DrawTacticalMap.DrawCelestialObjects(screenParameters, environment);

            DrawTacticalMap.DrawActiveCelestialObjects(screenParameters, environment);

            DrawTacticalMap.DrawDirections(screenParameters, environment);

            DrawTacticalMap.DrawHistoryTrajectory(screenParameters, environment, _history);
        }
コード例 #2
0
        private void RefreshControl()
        {
            txtMouseX.Text = MouseCoordinates.X + "";
            txtMouseY.Text = MouseCoordinates.Y + "";

            if (SpacecraftLocation != PointF.Empty)
            {
                txtSpacecraftX.Text = SpacecraftLocation.X + "";
                txtSpacecraftY.Text = SpacecraftLocation.Y + "";
            }

            if (TargetLocation != PointF.Empty)
            {
                txtTargetX.Text = TargetLocation.X + "";
                txtTargetY.Text = TargetLocation.Y + "";
            }

            Image image = new Bitmap(Width, Height);

            var graphics = Graphics.FromImage(image);

            graphics.CompositingQuality = CompositingQuality.HighQuality;
            graphics.InterpolationMode  = InterpolationMode.Bicubic;
            graphics.SmoothingMode      = SmoothingMode.AntiAlias;
            graphics.TextRenderingHint  = TextRenderingHint.AntiAlias;

            var screenParameters =
                new ScreenParameters(Width, Height, Width / 2, Height / 2)
            {
                GraphicSurface = graphics
            };

            DrawTacticalMap.DrawBackGround(screenParameters);

            if (isStarted)
            {
                DrawCalculationSteps(screenParameters);

                DrawSpacecraft(screenParameters);

                DrawTargetPoint(screenParameters);
            }



            if (CurrentMode == Mode.SetSpaceShipLocation)
            {
                var color = Color.DarkOliveGreen;

                screenParameters.GraphicSurface.FillEllipse(new SolidBrush(color), MouseCoordinates.X - 2, MouseCoordinates.Y - 2, 4, 4);
                screenParameters.GraphicSurface.DrawEllipse(new Pen(color), MouseCoordinates.X - 4, MouseCoordinates.Y - 4, 8, 8);
            }

            if (CurrentMode == Mode.SetTargetLocation)
            {
                var color = Color.Maroon;

                screenParameters.GraphicSurface.FillEllipse(new SolidBrush(color), MouseCoordinates.X - 2, MouseCoordinates.Y - 2, 4, 4);
                screenParameters.GraphicSurface.DrawEllipse(new Pen(color), MouseCoordinates.X - 4, MouseCoordinates.Y - 4, 8, 8);
            }

            BackgroundImage = image;
        }