Polyphase Game Engine
Loading...
Searching...
No Matches
ProgressBar Class Reference

#include <ProgressBar.h>

Inheritance diagram for ProgressBar:
Widget Node Object

Public Member Functions

 DECLARE_NODE (ProgressBar, Widget)
 
virtual void Create () override
 
virtual void GatherProperties (std::vector< Property > &props) override
 
virtual void EditorTick (float deltaTime) override
 
virtual void PreRender () override
 
void SetValue (float value)
 
float GetValue () const
 
void SetMinValue (float min)
 
float GetMinValue () const
 
void SetMaxValue (float max)
 
float GetMaxValue () const
 
float GetRatio () const
 
void SetShowPercentage (bool show)
 
bool IsShowingPercentage () const
 
void SetBackgroundColor (glm::vec4 color)
 
glm::vec4 GetBackgroundColor ()
 
void SetFillColor (glm::vec4 color)
 
glm::vec4 GetFillColor ()
 
void SetTextColor (glm::vec4 color)
 
glm::vec4 GetTextColor ()
 
QuadGetBackgroundQuad ()
 
QuadGetFillQuad ()
 
TextGetTextWidget ()
 
- Public Member Functions inherited from Widget
 DECLARE_NODE (Widget, Node)
 
 Widget ()
 
virtual void Start () override
 
virtual void SetVisible (bool visible) override
 
virtual void PrepareTick (std::vector< NodePtrWeak > &outTickNodes, bool game, bool recurse) override
 
virtual void Render () override
 
virtual VertexType GetVertexType () const override
 
virtual bool IsWidget () const override
 
WidgetGetParentWidget ()
 
const WidgetGetParentWidget () const
 
WidgetGetChildWidget (int32_t index)
 
Rect GetRect ()
 
void SetX (float x)
 
void SetY (float y)
 
void SetWidth (float width)
 
void SetHeight (float height)
 
void SetXRatio (float x)
 
void SetYRatio (float y)
 
void SetWidthRatio (float width)
 
void SetHeightRatio (float height)
 
void SetLeftMargin (float left)
 
void SetTopMargin (float top)
 
void SetRightMargin (float right)
 
void SetBottomMargin (float bottom)
 
virtual void SetPosition (float x, float y)
 
virtual void SetDimensions (float width, float height)
 
void SetPosition (glm::vec2 position)
 
void SetDimensions (glm::vec2 dimensions)
 
void SetRect (float x, float y, float width, float height)
 
void SetRect (glm::vec2 position, glm::vec2 dimensions)
 
void SetRect (Rect rect)
 
void SetRatios (float x, float y, float width, float height)
 
void SetMargins (float left, float top, float right, float bottom)
 
void SetOffset (float x, float y)
 
glm::vec2 GetOffset () const
 
void SetSize (float x, float y)
 
glm::vec2 GetSize () const
 
AnchorMode GetAnchorMode () const
 
void SetAnchorMode (AnchorMode anchorMode)
 
bool AnchorStretchesX (AnchorMode mode) const
 
bool AnchorStretchesY (AnchorMode mode) const
 
bool StretchX () const
 
bool StretchY () const
 
glm::vec2 GetAnchorRatio () const
 
void SetFullScreen ()
 
void Centered ()
 
void CenterPivot ()
 
float GetX () const
 
float GetY () const
 
float GetWidth () const
 
float GetHeight () const
 
glm::vec2 GetPosition () const
 
glm::vec2 GetDimensions () const
 
void UpdateRect ()
 
void UpdateColor ()
 
void FitInsideParent ()
 
float GetParentWidth () const
 
float GetParentHeight () const
 
virtual void SetColor (glm::vec4 color)
 
glm::vec4 GetColor () const
 
void SetOpacity (uint8_t opacity)
 
uint8_t GetOpacity () const
 
void SetOpacityFloat (float opacity)
 
float GetOpacityFloat () const
 
virtual bool ShouldHandleInput ()
 
virtual void MarkDirty ()
 
void MarkClean ()
 
bool IsDirty () const
 
bool ContainsMouse (bool testScissor=true) const
 
virtual bool ContainsPoint (int32_t x, int32_t y)
 
void MoveToMousePosition ()
 
const glm::mat3 & GetTransform ()
 
void SetRotation (float degrees)
 
float GetRotation () const
 
void SetPivot (glm::vec2 pivot)
 
glm::vec2 GetPivot () const
 
void SetScale (glm::vec2 scale)
 
glm::vec2 GetScale () const
 
glm::vec2 GetAbsoluteScale () const
 
bool IsScissorEnabled () const
 
void EnableScissor (bool enable)
 
Rect GetScissorRect () const
 
void SetUseGameResolution (bool use)
 
bool GetUseGameResolution () const
 
void SetTooltipName (const std::string &name)
 
const std::string & GetTooltipName () const
 
void SetTooltipDescription (const std::string &description)
 
const std::string & GetTooltipDescription () const
 
bool HasTooltip () const
 
- Public Member Functions inherited from Node
 DECLARE_FACTORY_MANAGER (Node)
 
 DECLARE_FACTORY (Node, Node)
 
 DECLARE_OBJECT (Node, Object)
 
 DECLARE_SCRIPT_LINK_BASE (Node)
 
 Node ()
 
virtual ~Node ()
 
virtual void Destroy ()
 
void DestroyDeferred ()
 
void Doom ()
 
virtual void SaveStream (Stream &stream, Platform platform)
 
virtual void LoadStream (Stream &stream, Platform platform, uint32_t version)
 
virtual void Copy (Node *srcNode, bool recurse)
 
virtual void Render (PipelineConfig pipelineConfig)
 
virtual void Awake ()
 
virtual void Stop ()
 
virtual void Tick (float deltaTime)
 
uint32_t GetLastTickedFrame () const
 
virtual void OnInstanced ()
 
virtual void GatherReplicatedData (std::vector< NetDatum > &outData)
 
virtual void GatherNetFuncs (std::vector< NetFunc > &outFuncs)
 
void GatherPropertyOverrides (std::vector< Property > &outOverrides)
 
void ApplyPropertyOverrides (const std::vector< Property > &overs)
 
virtual void BeginOverlap (Primitive3D *thisComp, Primitive3D *otherComp)
 
virtual void EndOverlap (Primitive3D *thisComp, Primitive3D *otherComp)
 
virtual void OnCollision (Primitive3D *thisComp, Primitive3D *otherComp, glm::vec3 impactPoint, glm::vec3 impactNormal, btPersistentManifold *manifold)
 
NodeId GetNodeId () const
 
uint64_t GetPersistentUuid () const
 
void SetPersistentUuid (uint64_t uuid)
 
void EnsurePersistentUuid ()
 
void EmitSignal (const std::string &name, const std::vector< Datum > &args)
 
void ConnectSignal (const std::string &name, Node *listener, SignalHandlerFP func)
 
void ConnectSignal (const std::string &name, Node *listener, const ScriptFunc &func)
 
void DisconnectSignal (const std::string &name, Node *listener)
 
void RenderShadow ()
 
void RenderSelected (bool renderChildren)
 
NodeCreateChild (TypeId nodeType)
 
NodeCreateChild (const char *typeName)
 
NodeCreateChildClone (Node *srcNode, bool recurse)
 
NodePtr Clone (bool recurse, bool instantiateLinkedScene=true, bool resolveNodePaths=false)
 
void DestroyAllChildren ()
 
NodeGetRoot ()
 
bool IsWorldRoot () const
 
NodeGetSubRoot ()
 
template<class NodeClass >
NodeClass * CreateChild ()
 
template<class NodeClass >
SharedPtr< NodeClass > CreateChildSp ()
 
template<class NodeClass >
NodeClass * CreateChild (const char *name)
 
template<class NodeClass >
SharedPtr< NodeClass > CreateChildSp (const char *name)
 
bool IsDestroyed () const
 
bool IsPendingDestroy () const
 
bool IsDoomed () const
 
bool HasStarted () const
 
bool HasAwoken () const
 
void EnableTick (bool enable)
 
bool IsTickEnabled () const
 
virtual void SetWorld (World *world, bool subRoot)
 
WorldGetWorld ()
 
void SetScene (Scene *scene)
 
SceneGetScene ()
 
uint8_t GetTargetScreen () const
 
void SetTargetScreen (uint8_t screen)
 
std::vector< NetDatum > & GetReplicatedData ()
 
void SetNetId (NetId id)
 
NetId GetNetId () const
 
NetHostId GetOwningHost () const
 
void SetOwningHost (NetHostId hostId, bool setAsPawn=false)
 
void SetReplicate (bool replicate)
 
bool IsReplicated () const
 
void SetReplicateTransform (bool repTransform)
 
bool IsTransformReplicated () const
 
void ForceReplication ()
 
void ClearForcedReplication ()
 
bool NeedsForcedReplication ()
 
virtual bool CheckNetRelevance (Node *playerNode)
 
bool IsAlwaysRelevant () const
 
void SetAlwaysRelevant (bool alwaysRelevant)
 
bool HasTag (const std::string &tag)
 
void AddTag (const std::string &tag)
 
void RemoveTag (const std::string &tag)
 
void SetName (const std::string &newName)
 
const std::string & GetName () const
 
virtual void SetActive (bool active)
 
bool IsActive (bool recurse=false) const
 
bool IsVisible (bool recurse=false) const
 
void SetTransient (bool transient)
 
virtual bool IsTransient () const
 
void SetPersistent (bool persistent)
 
bool IsPersistent () const
 
void SetDefault (bool isDefault)
 
bool IsDefault () const
 
void SetUserdataCreated (bool created)
 
bool IsUserdataCreated () const
 
virtual const char * GetTypeName () const
 
virtual DrawData GetDrawData ()
 
virtual bool IsNode3D () const
 
virtual bool IsPrimitive3D () const
 
virtual bool IsLight3D () const
 
NodeGetParent ()
 
const NodeGetParent () const
 
const std::vector< NodePtr > & GetChildren () const
 
virtual void Attach (Node *parent, bool keepWorldTransform=false, int32_t index=-1)
 
void Detach (bool keepWorldTransform=false)
 
void AddChild (Node *child, int32_t index=-1)
 
void RemoveChild (Node *child)
 
void RemoveChild (int32_t index)
 
template<typename T >
void AddChild (const SharedPtr< T > &child, int32_t index=-1)
 
template<typename T >
void RemoveChild (const SharedPtr< Node > &child)
 
int32_t FindChildIndex (const std::string &name) const
 
int32_t FindChildIndex (Node *child) const
 
NodeFindChild (const std::string &name, bool recurse) const
 
NodeFindChildWithTag (const std::string &name, bool recurse) const
 
NodeFindDescendant (const std::string &name)
 
NodeFindAncestor (const std::string &name)
 
bool HasAncestor (Node *node)
 
NodeGetChild (int32_t index) const
 
NodeGetChildByType (TypeId type) const
 
uint32_t GetNumChildren () const
 
int32_t FindParentNodeIndex () const
 
void SetHitCheckId (uint32_t id)
 
uint32_t GetHitCheckId () const
 
bool IsLateTickEnabled () const
 
void EnableLateTick (bool enable)
 
ScriptGetScript ()
 
void SetScriptFile (const std::string &fileName)
 
bool DoChildrenHaveUniqueNames () const
 
void BreakSceneLink ()
 
bool IsSceneLinked (bool ignoreInPie=true) const
 
bool IsSceneLinkedChild (bool ignoreInPie=true)
 
bool IsForeign () const
 
bool HasAuthority () const
 
bool IsOwned () const
 
bool IsLocallyControlled () const
 
Datum GetField (const std::string &key)
 
void SetField (const std::string &name, const Datum &value)
 
Datum GetField (int32_t key)
 
void SetField (int32_t key, const Datum &value)
 
Datum CallFunction (const std::string &name, const std::vector< Datum > &args={})
 
NetFuncFindNetFunc (const char *name)
 
NetFuncFindNetFunc (uint16_t index)
 
void InvokeNetFunc (const char *name)
 
void InvokeNetFunc (const char *name, Datum param0)
 
void InvokeNetFunc (const char *name, Datum param0, Datum param1)
 
void InvokeNetFunc (const char *name, Datum param0, Datum param1, Datum param2)
 
void InvokeNetFunc (const char *name, Datum param0, Datum param1, Datum param2, Datum param3)
 
void InvokeNetFunc (const char *name, Datum param0, Datum param1, Datum param2, Datum param3, Datum param4)
 
void InvokeNetFunc (const char *name, Datum param0, Datum param1, Datum param2, Datum param3, Datum param4, Datum param5)
 
void InvokeNetFunc (const char *name, Datum param0, Datum param1, Datum param2, Datum param3, Datum param4, Datum param5, Datum param6)
 
void InvokeNetFunc (const char *name, Datum param0, Datum param1, Datum param2, Datum param3, Datum param4, Datum param5, Datum param6, Datum param7)
 
void InvokeNetFunc (const char *name, const std::vector< Datum > &params)
 
const WeakPtr< Node > & GetSelfPtr () const
 
template<typename T >
T * FindChild (const std::string &name, bool recurse)
 
template<typename T >
void Traverse (T func, bool inverted=false)
 
template<typename T >
bool ForEach (T func, bool inverted=false)
 
- Public Member Functions inherited from Object
virtual ~Object ()=default
 
virtual const char * RuntimeName () const =0
 
virtual const char * RuntimeParentName () const =0
 
virtual RuntimeId InstanceRuntimeId () const =0
 
virtual ObjectQueryInterface (RuntimeId id) const
 
virtual bool Is (RuntimeId id) const
 
virtual bool Is (const char *name) const
 
virtual bool DrawCustomProperty (Property &prop)
 
template<typename T >
T * As () const
 
virtual bool Equals (const Object *rhs) const
 

Protected Member Functions

void UpdateAppearance ()
 
- Protected Member Functions inherited from Widget
virtual void SetParent (Node *parent) override
 
float PixelsToRatioX (float x) const
 
float PixelsToRatioY (float y) const
 
float RatioToPixelsX (float x) const
 
float RatioToPixelsY (float y) const
 
void PushScissor ()
 
void PopScissor ()
 
void SetScissor (Rect &area)
 
- Protected Member Functions inherited from Node
void TickCommon (float deltaTime)
 
void ValidateUniqueChildName (Node *newChild)
 
void SendNetFunc (NetFunc *func, uint32_t numParams, const Datum **params)
 

Static Protected Member Functions

static bool HandlePropChange (Datum *datum, uint32_t index, const void *newValue)
 
- Static Protected Member Functions inherited from Widget
static bool HandlePropChange (Datum *datum, uint32_t index, const void *newValue)
 
- Static Protected Member Functions inherited from Node
static bool HandlePropChange (Datum *datum, uint32_t index, const void *newValue)
 
static bool OnRep_OwningHost (Datum *datum, uint32_t index, const void *newValue)
 

Protected Attributes

float mValue = 0.5f
 
float mMinValue = 0.0f
 
float mMaxValue = 1.0f
 
bool mShowPercentage = true
 
TextureRef mBackgroundTexture
 
TextureRef mFillTexture
 
glm::vec4 mBackgroundColor = { 0.2f, 0.2f, 0.2f, 1.0f }
 
glm::vec4 mFillColor = { 0.3f, 0.6f, 0.9f, 1.0f }
 
glm::vec4 mTextColor = { 1.0f, 1.0f, 1.0f, 1.0f }
 
float mPadding = 2.0f
 
QuadmBackground = nullptr
 
QuadmFill = nullptr
 
TextmText = nullptr
 
- Protected Attributes inherited from Widget
Rect mRect
 
Rect mScissorRect
 
glm::mat3 mTransform
 
glm::vec4 mColor
 
glm::vec2 mOffset
 
glm::vec2 mSize
 
glm::vec2 mPivot
 
glm::vec2 mScale
 
glm::vec2 mAbsoluteScale
 
float mRotation
 
AnchorMode mAnchorMode
 
uint8_t mActiveMargins
 
bool mUseScissor
 
bool mUseGameResolution = false
 
uint8_t mOpacity
 
std::string mTooltipName
 
std::string mTooltipDescription
 
- Protected Attributes inherited from Node
std::string mName
 
WorldmWorld = nullptr
 
NodePtrWeak mParent
 
NodePtrWeak mSelf
 
std::vector< NodePtrmChildren
 
std::unordered_map< std::string, Node * > mChildNameMap
 
std::unordered_map< std::string, SignalmSignalMap
 
std::string mScriptFile
 
uint32_t mLastTickedFrame = 0
 
bool mActive = true
 
bool mVisible = true
 
bool mTransient = false
 
bool mPersistent = false
 
bool mDefault = false
 
bool mUserdataCreated = false
 
bool mHasStarted = false
 
bool mHasAwoken = false
 
bool mDestroyed = false
 
bool mTickEnabled = true
 
bool mLateTick = false
 
SceneRef mScene
 
uint8_t mTargetScreen = 0
 
std::vector< std::string > mTags
 
NodeId mNodeId = INVALID_NODE_ID
 
uint64_t mPersistentUuid = 0
 
std::vector< NetDatummReplicatedData
 
NetId mNetId = INVALID_NET_ID
 
NetHostId mOwningHost = INVALID_HOST_ID
 
bool mReplicate = false
 
bool mReplicateTransform = false
 
bool mForceReplicate = false
 
bool mAlwaysRelevant = true
 
ScriptmScript = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from Widget
static float InterfaceToNormalized (float interfaceCoord, float interfaceSize)
 
static bool IsMouseInside (Rect rect)
 
- Static Public Member Functions inherited from Node
static NodePtr Construct (const std::string &name)
 
static NodePtr Construct (TypeId typeId)
 
static void Destruct (Node *node)
 
static void ProcessPendingDestroys ()
 
static void RegisterNetFuncs (Node *node)
 
static void Deleter (Node *node)
 
template<class NodeClass >
static SharedPtr< NodeClass > Construct ()
 
- Static Public Member Functions inherited from Object
static const char * ClassRuntimeName ()
 
- Static Protected Attributes inherited from Widget
static WeakPtr< WidgetsWidgetToClean
 
static const char * sAnchorModeStrings []
 
- Static Protected Attributes inherited from Node
static std::unordered_map< TypeId, NetFuncMapsTypeNetFuncMap
 
static std::unordered_set< NodePtrWeaksPendingDestroySet
 
static NodeId sNextNodeId = NodeId(1)
 

Member Function Documentation

◆ Create()

void ProgressBar::Create ( )
overridevirtual

Reimplemented from Node.

◆ DECLARE_NODE()

ProgressBar::DECLARE_NODE ( ProgressBar  ,
Widget   
)

◆ EditorTick()

void ProgressBar::EditorTick ( float  deltaTime)
overridevirtual

Reimplemented from Node.

◆ GatherProperties()

void ProgressBar::GatherProperties ( std::vector< Property > &  props)
overridevirtual

Reimplemented from Widget.

◆ GetBackgroundColor()

glm::vec4 ProgressBar::GetBackgroundColor ( )

◆ GetBackgroundQuad()

Quad * ProgressBar::GetBackgroundQuad ( )

◆ GetFillColor()

glm::vec4 ProgressBar::GetFillColor ( )

◆ GetFillQuad()

Quad * ProgressBar::GetFillQuad ( )

◆ GetMaxValue()

float ProgressBar::GetMaxValue ( ) const

◆ GetMinValue()

float ProgressBar::GetMinValue ( ) const

◆ GetRatio()

float ProgressBar::GetRatio ( ) const

◆ GetTextColor()

glm::vec4 ProgressBar::GetTextColor ( )

◆ GetTextWidget()

Text * ProgressBar::GetTextWidget ( )

◆ GetValue()

float ProgressBar::GetValue ( ) const

◆ HandlePropChange()

bool ProgressBar::HandlePropChange ( Datum datum,
uint32_t  index,
const void *  newValue 
)
staticprotected

◆ IsShowingPercentage()

bool ProgressBar::IsShowingPercentage ( ) const

◆ PreRender()

void ProgressBar::PreRender ( )
overridevirtual

Reimplemented from Widget.

◆ SetBackgroundColor()

void ProgressBar::SetBackgroundColor ( glm::vec4  color)

◆ SetFillColor()

void ProgressBar::SetFillColor ( glm::vec4  color)

◆ SetMaxValue()

void ProgressBar::SetMaxValue ( float  max)

◆ SetMinValue()

void ProgressBar::SetMinValue ( float  min)

◆ SetShowPercentage()

void ProgressBar::SetShowPercentage ( bool  show)

◆ SetTextColor()

void ProgressBar::SetTextColor ( glm::vec4  color)

◆ SetValue()

void ProgressBar::SetValue ( float  value)

◆ UpdateAppearance()

void ProgressBar::UpdateAppearance ( )
protected

Member Data Documentation

◆ mBackground

Quad* ProgressBar::mBackground = nullptr
protected

◆ mBackgroundColor

glm::vec4 ProgressBar::mBackgroundColor = { 0.2f, 0.2f, 0.2f, 1.0f }
protected

◆ mBackgroundTexture

TextureRef ProgressBar::mBackgroundTexture
protected

◆ mFill

Quad* ProgressBar::mFill = nullptr
protected

◆ mFillColor

glm::vec4 ProgressBar::mFillColor = { 0.3f, 0.6f, 0.9f, 1.0f }
protected

◆ mFillTexture

TextureRef ProgressBar::mFillTexture
protected

◆ mMaxValue

float ProgressBar::mMaxValue = 1.0f
protected

◆ mMinValue

float ProgressBar::mMinValue = 0.0f
protected

◆ mPadding

float ProgressBar::mPadding = 2.0f
protected

◆ mShowPercentage

bool ProgressBar::mShowPercentage = true
protected

◆ mText

Text* ProgressBar::mText = nullptr
protected

◆ mTextColor

glm::vec4 ProgressBar::mTextColor = { 1.0f, 1.0f, 1.0f, 1.0f }
protected

◆ mValue

float ProgressBar::mValue = 0.5f
protected

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