void UpdateHudState() { HudState prevState = HudState; HudState = (HudState)(MyAPIGateway.Session.Config?.HudState ?? (int)HudState.HINTS); HudStateChanged?.Invoke(prevState, HudState); }
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; }
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); }
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); }
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; } }
protected override void GetBaseVariables(Bitmap bitmap, HudState currentState) { currentValue = currentState.Yaw; }
public abstract Bitmap DrawToImage(Bitmap bitmap, HudState currentState);
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; }
protected abstract void GetBaseVariables(Bitmap bitmap, HudState currentState);
protected override void GetBaseVariables(Bitmap bitmap, HudState currentState) { currentValue = currentState.Altitude; }