21 m_selectedItemIndex = 0;
22 m_displayStartIndex = 0;
24 m_itemListWraps =
true;
30 std::vector<MenuItem *>::iterator it;
31 for (it = m_menuItems.begin(); it != m_menuItems.end(); ++it)
40 if (m_displayCount > 0) m_itemListWraps =
false;
42 if (m_menuItems.size() > 0)
44 int8_t playerIndexOut;
46 const int FIRST_INDEX = 0;
47 const int LAST_INDEX = (int)(m_menuItems.size() - 1);
52 m_menuItems[m_selectedItemIndex]->Select(
this);
58 m_selectedItemIndex--;
60 if (m_selectedItemIndex >= m_menuItems.size())
62 m_selectedItemIndex = (m_itemListWraps) ? LAST_INDEX : FIRST_INDEX;
68 m_selectedItemIndex++;
70 if (m_selectedItemIndex >= m_menuItems.size())
72 m_selectedItemIndex = (m_itemListWraps) ? FIRST_INDEX : LAST_INDEX;
76 if (m_displayCount > 0)
78 if (m_selectedItemIndex < m_displayStartIndex)
80 m_displayStartIndex--;
82 else if (m_selectedItemIndex >= m_displayStartIndex + m_displayCount)
84 m_displayStartIndex++;
92 unsigned int index = 0;
94 std::vector<MenuItem *>::iterator it;
95 for (it = m_menuItems.begin(); it != m_menuItems.end(); ++it)
99 bool displayed = (m_displayCount == 0
100 || (index >= m_displayStartIndex
101 && index < m_displayStartIndex + m_displayCount));
104 pMenuItem->
SetSelected(index == m_selectedItemIndex);
105 pMenuItem->
Update(gameTime);
115 std::vector<MenuItem *>::iterator it;
116 for (it = m_menuItems.begin(); it != m_menuItems.end(); ++it)
129 pItem->
SetIndex((
int)m_menuItems.size());
131 m_menuItems.push_back(pItem);
Contains timing values for game updates and rendering.
Enables a group of sprites to be drawn using the same settings.
void Begin(const SpriteSortMode sortMode=SpriteSortMode::Deferred, const BlendState blendState=BlendState::Alpha, ALLEGRO_TRANSFORM *pTransformation=NULL)
Begins a sprite batch operation.
void End()
Flushes the sprite batch and restores the device state to how it was before Begin was called.
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...