void box_Accepted(object sender, EventArgs e) { m_UpgradeValue.Upgrade(); NextUpgradeCostString.Text = m_UpgradeValue.GetUpgradeCost().ToString(); LevelString.Text = "Level: " + m_UpgradeValue.GetUpgradeLevel().ToString(); UpgradeMenuScreen.SetFieldValue(this.m_UpgradeField, m_UpgradeValue); }
public void DrawSelection(UpgradeMenuScreen screen, GameTime gameTime) { SpriteBatch spriteBatch = screen.ScreenManager.SpriteBatch; spriteBatch.Draw(texture, CurrentSelectionAreaRec, m_color); if (m_UpgradeSlots == null) { return; } foreach (UpgradeSlot slot in m_UpgradeSlots) { slot.Draw(spriteBatch); } }
public void Draw(UpgradeMenuScreen screen, GameTime gameTime) { // Modify the alpha to fade text out during transitions. Color color = Color.White; color *= screen.TransitionAlpha; // Draw text, centered on the middle of each line. ScreenManager screenManager = screen.ScreenManager; SpriteBatch spriteBatch = screenManager.SpriteBatch; SpriteFont font = screenManager.Font; Vector2 origin = font.MeasureString(text) / 2; spriteBatch.Draw(texture, CurrentPosition, m_color); spriteBatch.DrawString(font, text, new Vector2(CurrentPosition.X + CurrentPosition.Width / 2, CurrentPosition.Y + CurrentPosition.Height / 2), color, Utilities.DegreesToRadians(90f), origin, 1.0f, SpriteEffects.None, 0); }