Esempio n. 1
0
 /// <summary>
 /// Draws text to the screen.
 /// </summary>
 /// <param name="renderableText">The text to draw.</param>
 /// <param name="position">The position to draw the text at.</param>
 /// <param name="rotation">The rotation of the text.</param>
 /// <param name="colour">The colour to draw the text in.</param>
 /// <param name="scale">The scale to draw the text at.</param>
 /// <param name="effect">The effect to apply to the text before drawing.</param>
 /// <param name="layerDepth">The layer depth of the text.</param>
 public static void Draw(RenderableText renderableText, Vector2 position, float rotation, Color colour, float scale = 1.0f, SpriteEffects effect = SpriteEffects.None, float layerDepth = 1.0f)
 {
     renderableText.spriteBatch.DrawString(renderableText.font, renderableText.text, position, colour, rotation, renderableText.origin, scale, effect, layerDepth);
 }
Esempio n. 2
0
 /// <summary>
 /// Draws text to the screen.
 /// </summary>
 /// <param name="renderableText">The text to draw.</param>
 /// <param name="position">The position to draw the text at.</param>
 /// <param name="rotation">The rotation of the text.</param>
 public static void Draw(RenderableText renderableText, Vector2 position, float rotation)
 {
     renderableText.spriteBatch.DrawString(renderableText.font, renderableText.text, position, renderableText.Colour, rotation, renderableText.origin, 1.0f, SpriteEffects.None, 1.0f);
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HeadsUpDisplay"/> class.
 /// </summary>
 /// <param name="displaySize">The size of the display area.</param>
 public HeadsUpDisplay(Vector2 displaySize)
 {
     this.displaySize = displaySize;
     this.powerUpBox = new Sprite();
     this.invincible = new Sprite();
     this.healthPowerUp = new Sprite();
     this.jump = new Sprite();
     this.speed = new Sprite();
     this.scoreText = new RenderableText();
     this.score = new RenderableText();
     this.healthText = new RenderableText();
     this.health = new RenderableText();
     this.ActivePowerUp = PowerUpType.None;
     this.Score = 0;
     this.HealthPercentage = 100.0f;
     this.powerUpPosition = new Vector2(this.displaySize.X * 0.5f, this.displaySize.Y * 0.1f);
     this.scoreTextPosition = new Vector2(this.displaySize.X * 0.572f, this.displaySize.Y * 0.075f);
     this.scorePosition = new Vector2(this.displaySize.X * 0.648f, this.displaySize.Y * 0.075f);
     this.healthTextPosition = new Vector2(this.displaySize.X * 0.355f, this.displaySize.Y * 0.075f);
     this.healthPosition = new Vector2(this.displaySize.X * 0.43f, this.displaySize.Y * 0.075f);
     this.textColour = new Color(50, 50, 50);
 }