Angel 3.2
A 2D Game Prototyping Engine
Public Member Functions | List of all members
HUDActor Class Reference

An Actor that gets drawn in screen-space. More...

#include <HUDActor.h>

+ Inheritance diagram for HUDActor:

Public Member Functions

virtual void Render ()
 
virtual const String GetClassName () const
 
- Public Member Functions inherited from Actor
 Actor ()
 
virtual ~Actor ()
 
void SetSize (float x, float y=-1.f)
 
void SetSize (const Vector2 &newSize)
 
const Vector2GetSize () const
 
const BoundingBox GetBoundingBox () const
 
virtual void SetPosition (float x, float y)
 
virtual void SetPosition (const Vector2 &pos)
 
const Vector2GetPosition () const
 
virtual void SetRotation (float rotation)
 
const float GetRotation () const
 
void SetColor (float r, float g, float b, float a=1.0f)
 
void SetColor (const Color &color)
 
const ColorGetColor () const
 
void SetAlpha (float newAlpha)
 
const float GetAlpha () const
 
virtual void SetDrawShape (actorDrawShape drawShape)
 
const actorDrawShapeGetDrawShape () const
 
void UseDisplayList (int listIndex)
 
void MoveTo (const Vector2 &newPosition, float duration, bool smooth=false, String onCompletionMessage="")
 
void RotateTo (float newRotation, float duration, bool smooth=false, String onCompletionMessage="")
 
void ChangeColorTo (const Color &newColor, float duration, bool smooth=false, String onCompletionMessage="")
 
void ChangeSizeTo (const Vector2 &newSize, float duration, bool smooth=false, String onCompletionMessage="")
 
void ChangeSizeTo (float newSize, float duration, bool smooth=false, String onCompletionMessage="")
 
int GetSpriteTexture (int frame=0) const
 
bool SetSprite (const String &filename, int frame=0, GLint clampmode=GL_CLAMP, GLint filtermode=GL_LINEAR, bool optional=false)
 
void ClearSpriteInfo ()
 
void LoadSpriteFrames (const String &firstFilename, GLint clampmode=GL_CLAMP, GLint filtermode=GL_LINEAR)
 
void PlaySpriteAnimation (float delay, spriteAnimationType animType=SAT_Loop, int startFrame=-1, int endFrame=-1, const char *animName=NULL)
 
void SetSpriteFrame (int frame)
 
int GetSpriteFrame () const
 
const bool IsSpriteAnimPlaying () const
 
virtual void AnimCallback (String animName)
 
void SetUVs (const Vector2 &lowleft, const Vector2 &upright)
 
void GetUVs (Vector2 &lowleft, Vector2 &upright) const
 
const bool IsTagged (const String &tag)
 
void Tag (const String &newTag)
 
void Untag (const String &oldTag)
 
const StringSet & GetTags () const
 
const String & SetName (String newName)
 
const String & GetName () const
 
virtual void ReceiveMessage (Message *message)
 
void SetLayer (int layerIndex)
 
void SetLayer (const String &layerName)
 
virtual void Update (float dt)
 
virtual void LevelUnloaded ()
 
ActorGetSelf ()
 
- Public Member Functions inherited from Renderable
 Renderable ()
 
virtual ~Renderable ()
 
void Destroy ()
 
bool IsDestroyed ()
 
int GetLayer ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Actor
static Actor *const GetNamed (const String &nameLookup)
 
static ActorCreate (const String &archetype)
 
static void SetScriptCreatedActor (Actor *a)
 
- Protected Member Functions inherited from Renderable
virtual void PreDestroy ()
 
- Protected Attributes inherited from Actor
Vector2 _size
 
Vector2 _position
 
Color _color
 
float _rotation
 
float _UV [8]
 
actorDrawShape _drawShape
 
int _spriteCurrentFrame
 
int _spriteNumFrames
 
float _spriteFrameDelay
 
float _spriteCurrentFrameDelay
 
int _spriteTextureReferences [MAX_SPRITE_FRAMES]
 
spriteAnimationType _spriteAnimType
 
int _spriteAnimStartFrame
 
int _spriteAnimEndFrame
 
int _spriteAnimDirection
 
int _displayListIndex
 
StringSet _tags
 
String _name
 
String _currentAnimName
 
- Static Protected Attributes inherited from Actor
static const float _squareVertices []
 
static float _circleVertices []
 
static float _circleTextureCoords []
 
static std::map< String, Actor * > _nameList
 
static Actor_scriptCreatedActor = NULL
 

Detailed Description

A HUDActor is drawn in screen-space rather than world-space. You can treat it just like any other normal Actor, but both its position and size are described in pixels instead of GL units. The screenspace coordinate system starts at the top-left of the window.

For example, to have an actor be 100 pixels wide and situated in the bottom-right quadrant of the window (assuming the default window size of 1024x768):

HUDActor *h = new HUDActor();
h->SetSize(100.0f);
h->SetPosition(974.0f, 718.0f);
theWorld.Add(h);

Definition at line 51 of file HUDActor.h.

Member Function Documentation

void HUDActor::Render ( )
virtual

Override of the Renderable::Render function to handle drawing in screen-space.

Reimplemented from Actor.

Definition at line 38 of file HUDActor.cpp.

virtual const String HUDActor::GetClassName ( ) const
inlinevirtual

Used by the SetName function to create a basename for this class. Overridden from Actor::GetClassName.

Returns
The string "HUDActor"

Reimplemented from Actor.

Definition at line 66 of file HUDActor.h.


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