public override void Draw(SpriteBatch spriteBatch) { base.Draw(spriteBatch); if (buttonTextLabel.text != "") { buttonTextLabel.centerPosition = new Vector2(position.X + size.X / 2, position.Y + size.Y / 2); buttonTextLabel.transparency = transparency; buttonTextLabel.enabled = enabled; buttonTextLabel.Draw(spriteBatch); } }
public override void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(menuBackground, BoundingRect(), currentSubMenuScreenIndex >= 0 ? CustomColors.darkerGray : Color.White); if (!scrolledToTop) { if (selectionArrowColor < 0) { spriteBatch.Draw(upArrow, UpArrowBoundingRect(), Color.White * 0.3f); selectionArrowColor++; } else { spriteBatch.Draw(upArrow, UpArrowBoundingRect(), currentSubMenuScreenIndex >= 0 ? CustomColors.darkerGray : Color.White); } } if (!scrolledToBottom) { if (selectionArrowColor > 0) { spriteBatch.Draw(downArrow, DownArrowBoundingRect(), null, Color.White * 0.3f, 0, Vector2.Zero, SpriteEffects.FlipVertically, 0); selectionArrowColor--; } else { spriteBatch.Draw(downArrow, DownArrowBoundingRect(), null, currentSubMenuScreenIndex >= 0 ? CustomColors.darkerGray : Color.White, 0, Vector2.Zero, SpriteEffects.FlipVertically, 0); } } foreach (MenuImage image in imageList) { if (image.position.Y + image.GetSize().Y <= ContentRect().Y + ContentRect().Size.Y&& image.position.Y >= ContentRect().Y) { image.Draw(spriteBatch); } } foreach (MenuSelection button in buttonList) { if (button.position.Y + buttonSize.Y <= ContentRect().Y + ContentRect().Size.Y&& button.position.Y >= ContentRect().Y) { if (currentSubMenuScreenIndex >= 0) { button.SetColor(CustomColors.darkerGray); } else { button.SetColor(Color.White); } button.Draw(spriteBatch); button.inScrollView = true; } else { button.inScrollView = false; } } foreach (MenuLabel label in labelList) { if (label.centerPosition.Y + label.SizeOfString().Y / 2 <= ContentRect().Y + ContentRect().Size.Y&& label.centerPosition.Y - label.SizeOfString().Y / 2 >= ContentRect().Y) { label.Draw(spriteBatch); } } titleLabel.Draw(spriteBatch); if (currentSubMenuScreenIndex >= 0) { subMenues[currentSubMenuScreenIndex].Draw(spriteBatch); } }