Class for menu items contained in a MenuScreen.
More...
#include <MenuItem.h>
Class for menu items contained in a MenuScreen.
◆ MenuItem()
| KatanaEngine::MenuItem::MenuItem |
( |
std::string |
text | ) |
|
Instantiate a menu item.
- Parameters
-
| text | The text that the item will display. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ Draw()
| void KatanaEngine::MenuItem::Draw |
( |
SpriteBatch * |
pSpriteBatch | ) |
|
|
virtual |
Called when the game determines it is time to draw a frame.
- Parameters
-
| pSpriteBatch | The game's sprite batch, used for rendering. |
◆ GetIndex()
| virtual int KatanaEngine::MenuItem::GetIndex |
( |
| ) |
const |
|
inlinevirtual |
Gets the index of the menu item.
- Returns
- Returns the menu item's index.
◆ GetMenuScreen()
| virtual MenuScreen* KatanaEngine::MenuItem::GetMenuScreen |
( |
| ) |
const |
|
inlineprotectedvirtual |
Gets the menu screen that contains this item.
- Returns
- Returns a pointer to the menu screen.
◆ GetPosition()
| virtual Vector2 KatanaEngine::MenuItem::GetPosition |
( |
| ) |
const |
|
inlineprotectedvirtual |
Gets the position of the menu item.
- Returns
- Returns the menu item's position on the screen.
◆ GetText()
| virtual std::string KatanaEngine::MenuItem::GetText |
( |
| ) |
const |
|
inlineprotectedvirtual |
Gets the text of the menu item.
- Returns
- Returns the menu item's text.
◆ IsDisplayed()
| virtual bool KatanaEngine::MenuItem::IsDisplayed |
( |
| ) |
const |
|
inlinevirtual |
Determines whether or not this menu item is currently displayed.
- Returns
- Returns true if this item is currently displayed, false otherwise.
◆ IsSelected()
| virtual bool KatanaEngine::MenuItem::IsSelected |
( |
| ) |
const |
|
inlinevirtual |
Determines whether or not this menu item is the one that is currently selected.
- Returns
- Returns true if this item is the currently selected one, false otherwise.
◆ Select()
| void KatanaEngine::MenuItem::Select |
( |
MenuScreen * |
pMenuScreen | ) |
|
|
virtual |
Called when the picks this menu option.
- Parameters
-
| pMenuScreen | A pointer to the menu screen. |
◆ SetAlpha()
| virtual void KatanaEngine::MenuItem::SetAlpha |
( |
const float |
alpha | ) |
|
|
inlinevirtual |
Sets the alpha value (opacity) of the menu item.
- Parameters
-
◆ SetColor()
| virtual void KatanaEngine::MenuItem::SetColor |
( |
const Color |
color | ) |
|
|
inlinevirtual |
Sets the color of the menu item.
- Parameters
-
◆ SetDisplayed()
| virtual void KatanaEngine::MenuItem::SetDisplayed |
( |
const bool |
isDisplayed | ) |
|
|
inlinevirtual |
Sets whether or not this menu item is currently displayed.
- Parameters
-
| isDisplayed | Pass true to display this item, and false to hide it. |
◆ SetFont()
| virtual void KatanaEngine::MenuItem::SetFont |
( |
Font * |
pFont | ) |
|
|
inlinevirtual |
Sets the font of the menu item.
- Parameters
-
| pFont | A pointer to the font. |
◆ SetIndex()
| virtual void KatanaEngine::MenuItem::SetIndex |
( |
const int |
index | ) |
|
|
inlineprotectedvirtual |
Sets the index of the menu item.
- Parameters
-
◆ SetMenuScreen()
| virtual void KatanaEngine::MenuItem::SetMenuScreen |
( |
MenuScreen * |
pMenuScreen | ) |
|
|
inlinevirtual |
◆ SetPosition()
| virtual void KatanaEngine::MenuItem::SetPosition |
( |
const Vector2 |
position | ) |
|
|
inlinevirtual |
Sets the screen position of the menu item.
- Parameters
-
| position | The new position. |
◆ SetSelectCallback()
| virtual void KatanaEngine::MenuItem::SetSelectCallback |
( |
OnSelect |
callback | ) |
|
|
inlinevirtual |
Sets the callback function for when the menu item is selected.
- Parameters
-
| callback | The callback function. |
◆ SetSelected()
| virtual void KatanaEngine::MenuItem::SetSelected |
( |
const bool |
isSelected | ) |
|
|
inlinevirtual |
Sets whether or not this menu item is the one that is currently selected.
- Parameters
-
| isSelected | Pass true to make this item the selected one, and false to when you no longer want it selected. |
◆ SetText()
| virtual void KatanaEngine::MenuItem::SetText |
( |
const std::string |
text | ) |
|
|
inlinevirtual |
Sets the text of the menu item.
- Parameters
-
◆ SetTextAlign()
| virtual void KatanaEngine::MenuItem::SetTextAlign |
( |
TextAlign |
textAlign | ) |
|
|
inlinevirtual |
Sets the text alignment for the menu item.
- Parameters
-
| textAlign | The text alignment. |
◆ SetTextOffset()
| virtual void KatanaEngine::MenuItem::SetTextOffset |
( |
const Vector2 |
offset | ) |
|
|
inlinevirtual |
Sets the offset from the items normal position. Usually used to animate the currently selected menu item.
- Parameters
-
◆ Update()
| virtual void KatanaEngine::MenuItem::Update |
( |
const GameTime * |
pGameTime | ) |
|
|
inlinevirtual |
Called when the game has determined that screen logic needs to be processed.
- Parameters
-
| pGameTime | Timing values including time since last update. |
The documentation for this class was generated from the following files: