public override void Draw(SpriteBatch spriteBatch, Point drawPosition) { if (!Visible) { return; } base.Draw(spriteBatch, drawPosition); DrawRectangle(spriteBatch, drawPosition, 0, 0, FullScreen ? 334 : 306, 24, Color.Black); int x = drawPosition.X + (int)Math.Round(WindowTitleText.Position.X * Scale); int y = drawPosition.Y + (int)Math.Round(WindowTitleText.Position.Y * Scale); WindowTitleText.Draw(spriteBatch, new Point(x, y)); }
public override void Draw(SpriteBatch spriteBatch, Point drawPosition) { base.Draw(spriteBatch, drawPosition); { int x = drawPosition.X + (int)Math.Round(NumberText.Position.X * Scale); int y = drawPosition.Y + (int)Math.Round(NumberText.Position.Y * Scale); NumberText.Draw(spriteBatch, new Point(x, y)); } { int x = drawPosition.X + (int)Math.Round(LettersText.Position.X * Scale); int y = drawPosition.Y + (int)Math.Round(LettersText.Position.Y * Scale); LettersText.Draw(spriteBatch, new Point(x, y)); } }
public override void Draw(SpriteBatch spriteBatch, Point drawPosition) { DrawRectangle(spriteBatch, drawPosition, 0, 0, Width, Height, Enabled ? ColorGrey : ColorDarkGrey); DrawIntRectangle(spriteBatch, drawPosition, 0, 0, 1, Height, ColorMediumGrey); DrawIntRectangle(spriteBatch, drawPosition, Width - 1, 0, 1, Height, ColorMediumGrey); DrawIntRectangle(spriteBatch, drawPosition, 0, 0, Width, 1, ColorMediumGrey); DrawIntRectangle(spriteBatch, drawPosition, 0, Height - 1, Width, 1, ColorMediumGrey); int x = drawPosition.X + (int)Math.Round(Yes.Position.X * Scale); int y = drawPosition.Y + (int)Math.Round(Yes.Position.Y * Scale); Yes.Draw(spriteBatch, new Point(x, y)); }
public override void Draw(SpriteBatch spriteBatch, Point drawPosition) { base.Draw(spriteBatch, drawPosition); DrawIntRectangle(spriteBatch, drawPosition, 0, 0, 1, Height, ColorMediumGrey); DrawIntRectangle(spriteBatch, drawPosition, Width - 1, 0, 1, Height, ColorMediumGrey); DrawIntRectangle(spriteBatch, drawPosition, 0, 0, Width, 1, ColorMediumGrey); DrawIntRectangle(spriteBatch, drawPosition, 0, Height - 1, Width, 1, ColorMediumGrey); int x = drawPosition.X + (int)Math.Round(Label.Position.X * Scale); int y = drawPosition.Y + (int)Math.Round(Label.Position.Y * Scale); Label.Draw(spriteBatch, new Point(x, y)); }
public override void Draw(SpriteBatch spriteBatch, Point drawPosition) { base.Draw(spriteBatch, drawPosition); DrawIntRectangle(spriteBatch, drawPosition, 0, 0, 1, Height, ColorMediumGrey); DrawIntRectangle(spriteBatch, drawPosition, Width - 1, 0, 1, Height, ColorMediumGrey); DrawIntRectangle(spriteBatch, drawPosition, 0, 0, Width, 1, ColorMediumGrey); DrawIntRectangle(spriteBatch, drawPosition, 0, Height - 1, Width, 1, ColorMediumGrey); if (CursorVisible && DMI.Blinker2Hz) { DrawIntRectangle(spriteBatch, drawPosition, Cursor.X, Cursor.Y, Cursor.Width, Cursor.Height, Color.Black); } int x = drawPosition.X + (int)Math.Round(Data.Position.X * Scale); int y = drawPosition.Y + (int)Math.Round(Data.Position.Y * Scale); Data.Draw(spriteBatch, new Point(x, y)); }
public override void Draw(SpriteBatch spriteBatch, Point position) { base.Draw(spriteBatch, position); if (DisplayDistanceBar) { DrawRectangle(spriteBatch, position, DistanceBar.X, DistanceBar.Y + 30, DistanceBar.Z, DistanceBar.W, ColorGrey); // Distance speed lines foreach (int i in Enumerable.Range(0, 11)) { DrawIntRectangle(spriteBatch, position, DistanceLinePositionsX[i], DistanceLinePositionsY[i] + 30, 25 - DistanceLinePositionsX[i], (int)Math.Max(1, 1 / Scale), ColorGrey); } } if (DisplayDistanceText) { int x = position.X + (int)Math.Round(TargetDistanceText.Position.X * Scale); int y = position.Y + (int)Math.Round((TargetDistanceText.Position.Y + 54) * Scale); TargetDistanceText.Draw(spriteBatch, new Point(x, y)); } }
public override void Draw(SpriteBatch spriteBatch, Point position) { if (NeedleTexture == null) { NeedleTexture = new Texture2D(spriteBatch.GraphicsDevice, 16, 128); NeedleTexture.SetData(NeedleTextureData); } if (!Active) { return; } base.Draw(spriteBatch, position); int x, y; foreach (var lines in DialLineCoords) { x = position.X + (int)Math.Round(lines.X * Scale); y = position.Y + (int)Math.Round(lines.Y * Scale); var length = (int)Math.Round(lines.Z * Scale); spriteBatch.Draw(ColorTexture, new Rectangle(x, y, length, 1), null, Color.White, lines.W, new Vector2(0, 0), SpriteEffects.None, 0); } // Apply circular speed gauge shader spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, DepthStencilState.Default, null, DMI.Shader); // Draw gauge needle centre and speed limit markings spriteBatch.Draw(ColorTexture, new Vector2(position.X, position.Y), new Rectangle(0, 0, Width, Height), Color.Transparent, 0, new Vector2(0, 0), Scale, SpriteEffects.None, 0); // Re-apply DMI shader spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.LinearWrap, DepthStencilState.Default, null, null); // End of spritebatch change Shaders foreach (var text in DialSpeeds) { x = position.X + (int)(text.Position.X * Scale); y = position.Y + (int)(text.Position.Y * Scale); text.Draw(spriteBatch, new Point(x, y)); } x = position.X + (int)(Width * Scale / 2f); y = position.Y + (int)(Height * Scale / 2f); spriteBatch.Draw(NeedleTexture, new Vector2(x, y), null, NeedleColor, CurrentSpeedAngle, new Vector2(8, 105), Scale, SpriteEffects.None, 0); foreach (var text in CurrentSpeed) { if (text.Text == String.Empty) { continue; } x = position.X + (int)(text.Position.X * Scale); y = position.Y + (int)(text.Position.Y * Scale); text.Draw(spriteBatch, new Point(x, y)); } if (ReleaseSpeed.Text != String.Empty) { x = position.X + (int)(ReleaseSpeed.Position.X * Scale); y = position.Y + (int)(ReleaseSpeed.Position.Y * Scale); ReleaseSpeed.Draw(spriteBatch, new Point(x, y)); } }