Skip to content

ButtonBase.cs

Charles Humphrey edited this page Nov 16, 2017 · 1 revision

RandomchaosMGUIBase.UIBaseClasses.ButtonBase

This is the basic button UI control derived from ControlBase

Public Properties

Color TextColor

This denotes what color the text on the button should be.

string Text

This is the text that will be displayed on the button.

Vector2 ShadowOffset

This is the shadow offset for the text.

Color ShadowColor

This is the color of the text shadows.

Vector2? IconOffset

If an Icon asset is to be used, this offset can place it in the button, if left null, the icon will be placed in the center.

Vector2? TextOffset

This is used to place the text in the button, if left null, text will be placed in the center of the button.

bool IsSelceted

True if the button is selected.

Public Fields

Color HoverColor

Color of the button when the mouse is hovering over it.

Color ButtonDownColor

Color of the button when it is being pressed.

Public Methods

ButtonBase(Game game, Rectangle sizeRect, string text, string fontAsset, string iconAsset = null, Rectangle? iconRect = null, string backgroundAsset = null)

This is the constructor.

void Draw(GameTime gameTime)

As well as calling the base.Draw(gameTime) this then renders the Icons and text on the button.