SFML community forums
Help => Graphics => Topic started by: OutlawLee on May 07, 2012, 11:50:14 pm
-
My plan is to add a menu listing feature like:
text[id].setString(text[id].getString() + " >");
obviously doesnt work since i wanted to show you what im trying to do.
the ">" what indicate what option is currently selected.
got this, can i somehow add on the ">" sign on the end of text[id] string ?
example: if the string was "car" it would be "car >".
void Option::Set_Option (int id)
{
text[id].setString(text[id].getString());
App.draw(text[id]);
}
thx
-
For the sake of simplicity I'd go with a separate sf::Text that you place next to the active menu entry. Use sf::Text::setPosition() for positioning it and sf::Text::getGlobalBounds() to retrieve the position and size of the menu entry you're using as the reference.