Falcon
Public Member Functions | List of all members
UI::UI_Manager Class Reference

#include <UIManager.h>

Public Member Functions

 UI_Manager ()
 
 ~UI_Manager ()
 
CanvasGetCanvas ()
 
ButtonAddButton (std::string layer, glm::vec4 NBC, glm::vec4 HBC, glm::vec4 ABC, glm::vec4 NTC, glm::vec4 HTC, glm::vec4 ATC, glm::vec4 bounds, std::string text, boost::function< void()> callback)
 
SliderAddSlider (std::string layer, glm::vec4 NBC, glm::vec4 HBC, glm::vec4 ABC, glm::vec4 FBC, glm::vec4 NCC, glm::vec4 HCC, glm::vec4 ACC, glm::vec2 cursorSize, float barHeight, glm::vec4 bounds, float min, float max, float step)
 
ImageAddImage (std::string layer, std::string title, glm::vec4 bounds)
 
void ChangeImage (Image *bg, std::string title)
 
void LoadUI (std::string page)
 

Detailed Description

Main UI management system. Controls one canvas object for drawing UI on it.

Constructor & Destructor Documentation

◆ UI_Manager()

UI::UI_Manager::UI_Manager ( )

Main constructor. Creates and sets up the cavas object.

◆ ~UI_Manager()

UI::UI_Manager::~UI_Manager ( )

Destructor

Member Function Documentation

◆ AddButton()

Button * UI::UI_Manager::AddButton ( std::string  layer,
glm::vec4  NBC,
glm::vec4  HBC,
glm::vec4  ABC,
glm::vec4  NTC,
glm::vec4  HTC,
glm::vec4  ATC,
glm::vec4  bounds,
std::string  text,
boost::function< void()>  callback 
)

Primary function for adding a button to a UI layer.

Parameters
[in]astring indicating the title of the layer.
[in]coloras vec4 indicating default button color.
[in]coloras vec4 indicating hover button color.
[in]coloras vec4 indicating active button color.
[in]coloras vec4 indicating default text color.
[in]coloras vec4 indicating hover text color.
[in]coloras vec4 indicating active text color.
[in]coordinatesfor diagonally opposite points of the button(x1,y1,x2,y2)
[in]stringto be written on the button.
[in]acallback function indicating the action on click.
[out]apointer to the button object created

◆ AddImage()

Image * UI::UI_Manager::AddImage ( std::string  layer,
std::string  title,
glm::vec4  bounds 
)

Primary function for adding a background image to a UI layer.

Parameters
[in]astring indicating the title of the layer.
[in]thename of the image file with extention as string.
[in]coordinatesfor diagonally opposite points of the image(x1,y1,x2,y2)
[out]apointer to the background object created.

◆ AddSlider()

Slider * UI::UI_Manager::AddSlider ( std::string  layer,
glm::vec4  NBC,
glm::vec4  HBC,
glm::vec4  ABC,
glm::vec4  FBC,
glm::vec4  NCC,
glm::vec4  HCC,
glm::vec4  ACC,
glm::vec2  cursorSize,
float  barHeight,
glm::vec4  bounds,
float  min,
float  max,
float  step 
)

Primary function for adding a slider onto a layer in UI.

Parameters
[in]astring indicating the title of the layer.
[in]coloras vec4 indicating default bar color.
[in]coloras vec4 indicating hover bar color.
[in]coloras vec4 indicating active bar color.
[in]coloras vec4 indicating filled bar color.
[in]coloras vec4 indicating default cursor color.
[in]coloras vec4 indicating hover cursor color.
[in]coloras vec4 indicating active cursor color.
[in]thesize of the cursor on the bar
[in]theheight of the bar
[in]coordinatesfor diagonally opposite points of the slider box(x1,y1,x2,y2)
[in]minimumslider value in float.
[in]maximumslider value in float.
[in]step-sizefor the slider in float.
[out]pointerto the created slider object.

◆ ChangeImage()

void UI::UI_Manager::ChangeImage ( Image bg,
std::string  title 
)

Primary function for changing the image on a pre-existing background object.

Parameters
[in]pointerto the background object.
[in]thename of the image file with extention as string.

◆ GetCanvas()

Canvas* UI::UI_Manager::GetCanvas ( )
inline

◆ LoadUI()

void UI::UI_Manager::LoadUI ( std::string  page)

Load the requested layer through its title.

Parameters
[in]astring which basically indicates the title of the page for mapping.

The documentation for this class was generated from the following files: