FillBar Class Reference

#include <FillBar.h>

Description

Simple visual Entity representing a fraction of something.

In situations where you need a visual to show a bar, like a loading progress bar , or a health bar, this is a viable option.

Public Types

enum  FillDirection {
  Up,
  Left,
  Down,
  Right
}
 
enum  FillTransition {
  Instant,
  EaseSlow,
  EaseFast,
  LinearSlow,
  LinearFast
}
 
- Public Types inherited from Entity
enum  UpdateClass {
  Before,
  After
}
 

Functions

void SetDims (int w, int h)
 
void SetBorder (int px)
 
void SetFillDirection (FillDirection f)
 
void SetFillTransition (FillTransition f)
 
void SetColorFill (const Color &c)
 
void SetColorEmpty (const Color &c)
 
void SetColorBorder (const Color &c)
 
void SetFill (float f)
 
- Functions inherited from Entity
const std::vector< Entity::ID > & GetChildren () const
 
std::vector< Entity::IDGetAllSubEntities () const
 
bool Contains (Entity::ID)
 
std::vector< Entity::IDFindChildByName (const std::string &)
 
void Step ()
 
void Draw ()
 
void Attach (Entity::ID)
 
void Detach (Entity::ID)
 
template<typename T >
T * CreateChild ()
 
int GetNumChildren ()
 
double StepDuration ()
 
double DrawDuration ()
 
void SetPriority (Priority p)
 
void SetPriorityLast ()
 
void SetPriorityFirst ()
 
Priority GetPriority ()
 
EntityGetParent ()
 
bool HasParent ()
 
void Remove ()
 
void SetName (const std::string &name)
 
ID GetID ()
 
std::string GetName ()
 
void Watch (Variable v)
 
Variable GetWatched (const std::string &name)
 
std::vector< VariableGetWatchedVars ()
 
void Unwatch (const std::string &varName)
 
template<typename T >
T * AddComponent (UpdateClass when=UpdateClass::Before)
 
template<typename T >
T * QueryComponent ()
 
const std::vector< Component * > & GetComponents () const
 
void RemoveComponent (const std::string &tag)
 
void RemoveComponent (const Component *)
 
bool IsStepping ()
 
bool IsDrawing ()
 

Additional Inherited Members

- Static Functions inherited from Entity
template<typename T >
static Entity::ID Create ()
 
static Entity::ID Create ()
 
template<typename T >
static T * CreateReference ()
 
static std::vector< Entity::IDGetAll ()
 
- Properties inherited from Entity
bool step
 
bool draw
 
- Protected Member Functions inherited from Entity
virtual void OnEnter ()
 
virtual void OnDepart ()
 
virtual void OnRemove ()
 
virtual void OnPreStep ()
 
virtual void OnStep ()
 
virtual void OnPreDraw ()
 
virtual void OnDraw ()
 

Member Enumeration Documentation

enum FillDirection
strong

Sets the fill direction of the bar.

Enumerator
Up 

Fill from the bottom to the top.

Left 

Fill from the right to the left.

Down 

Fill from the top to the bottom.

Right 

Fill from the left to the right. This is the default.

enum FillTransition
strong

Sets how the bar will show the fraction of fill when it changes.

Enumerator
Instant 

Always shows exactly the fill amount.

EaseSlow 

Will slowly ease the bar to match the fill.

EaseFast 

Will quickly ease the bar to match the fill. This is the default.

LinearSlow 

Will linearly fill the bar at a moderate rate.

LinearFast 

Will linearly fill the bar at a slow rate.

Member Function Documentation

void SetDims ( int  w,
int  h 
)

Sets the dimensions of the bar.

void SetBorder ( int  px)

Sets the number of pixels to make the border.

void SetFillDirection ( FillDirection  f)

Sets the fill direction.

void SetFillTransition ( FillTransition  f)

Sets the fill transition.

void SetColorFill ( const Color c)

Sets the color of the filling visual.

void SetColorEmpty ( const Color c)

Sets the background color for the empty portion of the bar.

void SetColorBorder ( const Color c)

Sets the color of the fill border.

void SetFill ( float  f)

Sets the fill fraction amount.

Should be a fraction from 0.f to 1.f. If the amount is outside these ranges , the value is clamped.


The documentation for this class was generated from the following file:
  • /home/jc/git/Dynacoe/DynacoeSrc/includes/Dynacoe/BuiltIn/FillBar.h