Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SWCE::TraitEditButton Class Reference

edit traits (attributes and skills) More...

#include <traiteditbutton.hpp>

Inheritance diagram for SWCE::TraitEditButton:
Inheritance graph
Collaboration diagram for SWCE::TraitEditButton:
Collaboration graph

Public Types

enum  Rendermode { ForReal, ForCoords3D, ForCoordsGame }
 purpose of rendering. ForReal is "to display", ForCoords3D is "to determine where user has clicked" More...
 

Public Member Functions

 TraitEditButton ()
 constructor
 
void SetAssociatedTrait (const std::string &t)
 set name of trait, edited w/ this button
 
void Refresh ()
 rearrange
 
void SetAssociatedCharacter (SWRS::Character *c)
 associate button with particular character
 
void SetAssociatedLabelForPointsLeft (Label *l)
 label will be updated each time, trait is increased or decreased
 
void ValueUp ()
 increase associated parameter
 
void ValueDown ()
 decrease associated parameter
 
void SetBaseNumericValue (int i)
 set starting numeric value (it will be increased and decreased)
 
void SetBaseText (const std::string &t)
 set base text (numeric value will be automatically added to it)
 
void Clicked (float x, float y)
 
void Activate ()
 cancel effects of Deactiva
 
void Deactivate ()
 when deactivated, button is grayed and does not react to clicking
 
void SetClickHandler (ButtonHandler h)
 set function that will be called after clicking a button
 
void SetFontColor (float _r, float _g, float _b)
 set color of font More...
 
void SetFontHeight (float h)
 font size
 
void SetBackground (const std::string &bg)
 Set background of an label.
 
void MovementHandler ()
 rearrange after movement
 
void ResizeHandler ()
 rearrange after resizing
 
void UnloadResources ()
 free resources to save some space
 
void SetText (const std::string &t)
 set text to be displayed and formatted
 
const std::string & GetText ()
 get label text
 
void Initialize ()
 load resources, prepare to display
 
void Animate (float dt)
 some windows are animated
 
void Render (Rendermode mode)
 render something
 
virtual void Render (Renderable::Rendermode mode)
 rendering routine of a window
 
unsigned long GetTexelsCount ()
 sum of dimensionsxdepths of all textures
 
unsigned long GetFacesCount ()
 all 3D faces
 
WindowGetRoot ()
 recursive GetParent;
 
WindowGetParent ()
 Return parent window.
 
virtual void AttachChild (Window *child)
 attach child
 
virtual void DetachChild (Window *child)
 detach particular child
 
virtual void ReplaceChild (Window *old_child, Window *new_child)
 replace child. new is emplaced at position right before old one
 
virtual void SaveFile ()
 for autosave routine or else
 
float GetX ()
 return position x (from bottom left corner)
 
float GetY ()
 return position y (from bottom left corner)
 
float GetWidth ()
 return height of the window
 
float GetHeight ()
 return width of the window
 
virtual float SetX (float f)
 set position x (from bottom left corner)
 
virtual float SetY (float f)
 set position y (from bottom left corner)
 
virtual float SetWidth (float f)
 set width of the window
 
virtual float SetHeight (float f)
 set height of the window
 
virtual void SetWH (float w, float h)
 set width and height of the window
 
virtual void SetYX (float y, float x)
 set position - both coords (from bottom left corner)
 
virtual void JoystickAxes (int Axis, const float *direction)
 
virtual void SetParent (Window *_parent)
 set pointer to parent window
 
virtual void Maximize ()
 maximize
 
virtual void Released (float x, float y)
 
virtual void Dragged (float x, float y)
 
virtual void DraggedAngle (float x, float y)
 as degrees given current camera angle!
 
virtual void MenuButtonPressed ()
 menu button - on android phone (no such button on iphone)
 
virtual void BackButtonPressed ()
 back button - on android phone (no such button on iphone)
 
virtual void OnFocus ()
 window appears
 
float GetInitializedPercentage ()
 0= uninitialized; 100=ready; other? for progress bars
 
virtual void RefreshAssets ()
 To facilitate refreshing app after switching OpenGL Context (as in Android lifecycle)
 

Protected Member Functions

void AssembleActualText ()
 text is reassembled each time, value is changed
 
virtual void PrepareText ()
 prepare text to be displayed
 
virtual void PositionBackground ()
 configure background position
 
void ReplaceSelf (Window *replacement)
 replace reference to this in parent window for a new window does not delete this from main memory - only swaps pointer in parent window
 

Protected Attributes

std::string associated_trait_name
 name of trait edited
 
SWRS::Charactercharacter
 pointer to associated character
 
Labelpts_left
 label to be updated each use
 
std::string base_text
 description of a button (concatenated to numeric value)
 
int numeric_value
 a value to be set (increased/decreased after clicking)
 
ButtonHandler handler
 functor to be called upon clicking
 
bool active
 is button deactivated
 
float configured_x
 configured x coordinate (for movement handling)
 
float configured_y
 configured y coordinate (for movement handling)
 
float configured_w
 configured width (for movement handling)
 
float configured_h
 configured height (for movement handling)
 
Rectangle2D * rect
 background
 
std::string text
 text configured
 
float font_height
 font size
 
LxS::CoreGraphics::Fontfont
 font object
 
float r
 Text color - red.
 
float g
 Text color - green.
 
float b
 Text color - blue.
 
std::string background
 background image path
 
float initialized_percentage
 0-100; 0- just constructed; 100 - redy to render; 0-100 - for progressbar
 

Detailed Description

edit traits (attributes and skills)

Member Enumeration Documentation

purpose of rendering. ForReal is "to display", ForCoords3D is "to determine where user has clicked"

Enumerator
ForReal 

proper rendering for display

ForCoords3D 

rendering for coordinate detection

ForCoordsGame 

for detection of ingame coordinate system - unused

Member Function Documentation

void UpDownButton::Clicked ( float  x,
float  y 
)
virtualinherited

window was clicked; coordinates from left-bottom corner of the window

Reimplemented from LxS::Windowing::Button.

void Window::Dragged ( float  x,
float  y 
)
virtualinherited

object within window is dragged; coordinates from left-bottom corner of the window

Reimplemented in LxS::Windowing::VirtualKeypad, LxS::Game::MapWindow, LxS::Windowing::Form, LxS::Windowing::SplashWindow, LxS::Game::Help::Help, and LxS::Windowing::ContainerWindow.

virtual void LxS::Windowing::Window::JoystickAxes ( int  Axis,
const float *  direction 
)
inlinevirtualinherited

axis-numbering: 0-1, left analog X-Y; 2-3, right analog 4-7 - nothing; 8 d-pad up; 9 dpad right; 10 dpad down; 11 dpad left 12 - l2, 13-r2, 14- l1, 15 - r1 16 - triangle, 17 - circle, 18 - cross, 19 - square; 20 - nothing

Reimplemented in LxS::Game::MapWindow, Labyrinth::Root, LxS::Windowing::Root, and SWCE::RaceSelectionForm.

void Window::Released ( float  x,
float  y 
)
virtualinherited

window was pressed and released; coordinates from left-bottom corner of the window

Reimplemented in LxS::Game::MapWindow, LxS::Windowing::Form, LxS::Game::DialogueLine, LxS::Windowing::SplashWindow, and LxS::Windowing::ContainerWindow.

void LxS::Windowing::Label::SetFontColor ( float  _r,
float  _g,
float  _b 
)
inlineinherited

set color of font

Parameters
_rred
_ggreen
_bblue

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