Aether
SDL2 based UI Framework for NX
MenuOption.hpp
1 #ifndef AETHER_MENUOPTION_HPP
2 #define AETHER_MENUOPTION_HPP
3 
4 #include "Aether/base/Element.hpp"
5 #include "Aether/primary/Rectangle.hpp"
6 #include "Aether/primary/Text.hpp"
7 
8 namespace Aether {
13  class MenuOption : public Element {
14  private:
16  bool active;
18  Colour activeColour;
20  Colour inactiveColour;
22  Rectangle * rect;
24  Text * text;
25 
26  public:
35  MenuOption(std::string s, Colour a, Colour ia, std::function<void()> f);
36 
42  void setW(int w);
43 
49  void setActive(bool b);
50 
56  void setActiveColour(Colour c);
57 
63  void setInactiveColour(Colour c);
64  };
65 };
66 
67 #endif
A rectangle is a texture containing either a normal or rounded rectangle.
Definition: Rectangle.hpp:11
MenuOption(std::string s, Colour a, Colour ia, std::function< void()> f)
Construct a new Menu Option object.
void setInactiveColour(Colour c)
Set the inactive colour for option.
void setW(int w)
Updates width for menu option Setting new width also adjusts the width of text texture if necessary...
Element for rendering a single line of text. It can optionally scroll when overflowing.
Definition: Text.hpp:15
void setActiveColour(Colour c)
Set the active colour for option.
int w()
Returns width of element.
Stores RGBA values representing a colour. Each component can be within the range 0 to 255 (inclusive)...
Definition: Colour.hpp:9
Element is the base class to be inherited to form all other types of elements.
Definition: Element.hpp:18
Base namespace for all Aether related classes and functions.
virtual void setActive()
Set element as activated.
A MenuOption is a combination of elements which looks like and functions similar to Horizon&#39;s...
Definition: MenuOption.hpp:13