Example #1
0
        void UpdateHudState()
        {
            HudState prevState = HudState;

            HudState = (HudState)(MyAPIGateway.Session.Config?.HudState ?? (int)HudState.HINTS);
            HudStateChanged?.Invoke(prevState, HudState);
        }
Example #2
0
        public override System.Drawing.Bitmap DrawToImage(Bitmap bitmap, HudState currentState)
        {
            using (Graphics graphics = Graphics.FromImage(bitmap))
            {
                DrawCross(graphics);
            }

            return(bitmap);
        }
        public override System.Drawing.Bitmap DrawToImage(Bitmap bitmap, HudState currentState)
        {
            using (Graphics graphics = Graphics.FromImage(bitmap))
            {
                DrawCross(graphics);
            }

            return bitmap;
        }
Example #4
0
        public override void Start()
        {
            base.Start();

            state = GameState.HudState;

            state.LivesChanged += State_LivesChanged;
            state.ControllerInitialized();
        }
        public override Bitmap DrawToImage(Bitmap bitmap, HudState currentState)
        {
            GetBaseLineVariables(bitmap, currentState);

            using (Graphics graphics = Graphics.FromImage(bitmap))
            {
                DrawBaseLines(graphics);
            }
   
            return bitmap;
        }
        public override Bitmap DrawToImage(Bitmap bitmap, HudState currentState)
        {
            GetBaseLineVariables(bitmap, currentState);

            using (Graphics graphics = Graphics.FromImage(bitmap))
            {
                DrawBaseLines(graphics);
            }

            return(bitmap);
        }
Example #7
0
        public override System.Drawing.Bitmap DrawToImage(Bitmap bitmap, HudState currentState)
        {
            GetBaseVariables(bitmap, currentState);

            using (Graphics graphics = Graphics.FromImage(bitmap))
            {
                DrawEmptyBattery(graphics);
                DrawBatteryLines(graphics);
            }

            return(bitmap);
        }
        public override System.Drawing.Bitmap DrawToImage(System.Drawing.Bitmap bitmap, HudState currentState)
        {
            GetBaseVariables(bitmap, currentState);

            using (Graphics graphics = Graphics.FromImage(bitmap))
            {
                DrawArrow(graphics);
                DrawLines(graphics);
            }

            return bitmap;
        }
        private void GetBaseLineVariables(Bitmap image, HudState currentState)
        {
            int currentInitY = (int)Math.Round(Math.Tan(currentState.PitchRadian) / Math.Tan(constants.CameraFieldOfViewAngleRadian / 2.0) * image.Height);
            int currentInitYPlus10 = (int)Math.Round(Math.Tan(currentState.PitchRadian + 0.174) / Math.Tan(constants.CameraFieldOfViewAngleRadian / 2.0) * image.Height);
            tenDegreeMovementDistance = currentInitYPlus10 - currentInitY;

            double currentIncrementFactor = Math.Tan(currentState.RollRadian);

            startPoint = new Point(currentWidth / 2, currentHeight / 2 + currentInitY);

            lineVector = NormalizeVector(new PointF(1.0f, -(float)currentIncrementFactor));
            // The normal vector does not need normalization since the line vector is alredy normalized
            normalVector = new PointF(-lineVector.Y, lineVector.X);
        }
Example #10
0
        private void GetBaseLineVariables(Bitmap image, HudState currentState)
        {
            int currentInitY       = (int)Math.Round(Math.Tan(currentState.PitchRadian) / Math.Tan(constants.CameraFieldOfViewAngleRadian / 2.0) * image.Height);
            int currentInitYPlus10 = (int)Math.Round(Math.Tan(currentState.PitchRadian + 0.174) / Math.Tan(constants.CameraFieldOfViewAngleRadian / 2.0) * image.Height);

            tenDegreeMovementDistance = currentInitYPlus10 - currentInitY;

            double currentIncrementFactor = Math.Tan(currentState.RollRadian);

            startPoint = new Point(currentWidth / 2, currentHeight / 2 + currentInitY);

            lineVector = NormalizeVector(new PointF(1.0f, -(float)currentIncrementFactor));
            // The normal vector does not need normalization since the line vector is alredy normalized
            normalVector = new PointF(-lineVector.Y, lineVector.X);
        }
Example #11
0
    private void ApplyState(HudState state)
    {
        hudState = state;

        switch (hudState)
        {
        case HudState.MainMenu:
            statsLabel.Text = "";
            statsLabel.Hide();
            startButton.Show();
            undoButton.Hide();
            break;

        case HudState.GameMenu:
            statsLabel.Text = "";
            statsLabel.Show();
            //startButton.Hide();
            undoButton.Show();
            break;
        }
    }
Example #12
0
 protected override void GetBaseVariables(Bitmap bitmap, HudState currentState)
 {
     currentValue = currentState.Yaw;
 }
Example #13
0
 public abstract Bitmap DrawToImage(Bitmap bitmap, HudState currentState);
Example #14
0
 public virtual void InitBaseVariables(Bitmap bitmap, HudState currentState)
 {
     currentWidth  = bitmap.Width;
     currentHeight = bitmap.Height;
 }
 protected void GetBaseVariables(Bitmap bitmap, HudState currentState)
 {
     currentBatteryLevel = currentState.BatteryLevel;
 }
 protected override void GetBaseVariables(Bitmap bitmap, HudState currentState)
 {
     currentValue = currentState.OverrallSpeed;
 }
Example #17
0
 public virtual void InitBaseVariables(Bitmap bitmap, HudState currentState)
 {
     currentWidth = bitmap.Width;
     currentHeight = bitmap.Height;
 }
Example #18
0
 protected abstract void GetBaseVariables(Bitmap bitmap, HudState currentState);
 protected abstract void GetBaseVariables(Bitmap bitmap, HudState currentState);
Example #20
0
 protected void GetBaseVariables(Bitmap bitmap, HudState currentState)
 {
     currentBatteryLevel = currentState.BatteryLevel;
 }
 protected override void GetBaseVariables(Bitmap bitmap, HudState currentState)
 {
     currentValue = currentState.Altitude;
 }
Example #22
0
 public abstract Bitmap DrawToImage(Bitmap bitmap, HudState currentState);