Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

TextArea Class Reference

#include <textarea.h>

Inheritance diagram for TextArea:

Inheritance graph
[legend]
Collaboration diagram for TextArea:

Collaboration graph
[legend]
List of all members.

Detailed Description

Area object with text.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Types

enum  TILINGMODE
 Tiling modes for area UV coords.

enum  HITTESTRESULT { OUTSIDE, INSIDE, EDGE }
 Identifiers for hit test result. More...


Public Member Functions

 TextArea (Object *pkParent, TextArea *pkObject=0)
virtual ~TextArea ()
virtual void SetAttribute (const AttributeBase &rkAttribute)
virtual void SetText (const std::string &rstrText)
virtual const std::string & GetText ()
virtual void SetFont (NeoEngine::FontPtr pkFont)
virtual NeoEngine::FontPtr GetFont ()
virtual void SetFontColor (const NeoEngine::Color &rkColor)
const NeoEngine::Color & GetFontColor ()
virtual bool Render (NeoEngine::Frustum *pkFrustum=0, bool bForce=false)
virtual void SetTextPadding (const Coord &rkPadding)
virtual const CoordGetTextPadding ()
virtual ObjectDuplicate (Object *pkParent=0, Object *pkObject=0)
virtual const CoordSetSize (const Coord &rkSize)
unsigned int ProcessMsg (Msg *pkMsg)
virtual void SetBackground (const NeoEngine::MaterialPtr &pkMat)
virtual void SetTilingMode (TILINGMODE eMode, int iX=1, int iY=1)
virtual void SetUVs (const Coord &rkOrigin, const Coord &rkRight, const Coord &rkBottom)
virtual NeoEngine::MaterialPtr & GetBackground ()
virtual const CoordSetPosition (const Coord &rkPos)
const CoordGetPosition () const
const CoordGetWorldPosition ()
const CoordGetSize () const
virtual void SetName (const NeoEngine::HashString &rstrName)
virtual const NeoEngine::HashString & GetName () const
unsigned int GetID () const
virtual ObjectGetParent ()
virtual ObjectGetRoot ()
virtual ObjectGetObject (const std::string &rstrName)
virtual const std::vector<
Object * > & 
GetChildObjects () const
virtual void AttachObject (Object *pkObject)
virtual void DetachObject (Object *pkObject)
virtual void AttachToObject (Object *pkParent)
virtual void AddHook (MsgHook *pkMsgHook)
virtual void RemoveHook (MsgHook *pkMsgHook)
virtual void Input (const NeoEngine::InputEvent *pkEvent)
HITTESTRESULT HitTest (const Coord &rkCoord)
virtual void Update (float fDeltaTime)

Public Attributes

std::string m_strText
bool m_bPassword

Protected Member Functions

void SetVertexBuffer ()
void SetPolygonBuffer ()
void UpdateWorldCache (bool bRecurse=true)

Protected Attributes

NeoEngine::FontPtr m_pkFont
Coord m_kPadding
NeoEngine::Color m_kFontColor
NeoEngine::MaterialPtr m_pkBackground
NeoEngine::VertexBufferPtr m_pkVertexBuffer
NeoEngine::PolygonBufferPtr m_pkPolygonBuffer
NeoEngine::RenderPrimitive * m_pkRenderPrim
TILINGMODE m_eTilingMode
int m_aiNumTiles [2]
Coord m_akUV [3]
unsigned int m_uiID
Objectm_pkParent
std::vector< Object * > m_vpkChildren
Coord m_kPos
Coord m_kWorldPos
Coord m_kSize
NeoEngine::HashString m_strName
std::vector< MsgHook * > m_vpkMsgHook
HITTESTRESULT m_eLastMouse


Member Enumeration Documentation

enum HITTESTRESULT [inherited]
 

Identifiers for hit test result.

Enumeration values:
OUTSIDE  Coordinate was outside area
INSIDE  Coordinate was inside area
EDGE  Coordinate was on edge of area


Constructor & Destructor Documentation

TextArea Object pkParent,
TextArea pkObject = 0
 

Parameters:
pkParent Parent object
pkObject Reference object to copy values from

virtual ~TextArea  )  [virtual]
 


Member Function Documentation

virtual void SetAttribute const AttributeBase rkAttribute  )  [virtual]
 

Set an attribute

Parameters:
rkAttribute Attribute

Reimplemented from Object.

virtual void SetText const std::string &  rstrText  )  [virtual]
 

Set text

Parameters:
rstrText Text

virtual const std::string& GetText  )  [virtual]
 

Returns:
Text

virtual void SetFont NeoEngine::FontPtr  pkFont  )  [virtual]
 

Set font

Parameters:
pkFont New font

virtual NeoEngine::FontPtr GetFont  )  [virtual]
 

Returns:
Current font

virtual void SetFontColor const NeoEngine::Color &  rkColor  )  [virtual]
 

Parameters:
rkColor New font color to use

const NeoEngine::Color& GetFontColor  ) 
 

Returns:
Current font color

virtual bool Render NeoEngine::Frustum *  pkFrustum = 0,
bool  bForce = false
[virtual]
 

Render object, recurses on children

Parameters:
pkFrustum Currently ignored
bForce Force rendering
Returns:
true if rendered, false if not

Reimplemented from Area.

virtual void SetTextPadding const Coord rkPadding  )  [virtual]
 

Set text padding

Parameters:
rkPadding Padding in pixels

virtual const Coord& GetTextPadding  )  [virtual]
 

Get text padding

Returns:
Padding in pixels

virtual Object* Duplicate Object pkParent = 0,
Object pkObject = 0
[virtual]
 

Duplicate and/or copy this object

Parameters:
pkParent Parent object to attach to
pkObject Object to copy data into, if null will allocate new object
Returns:
New object that is duplicate of this object

Reimplemented from Area.

void SetVertexBuffer  )  [protected, inherited]
 

Setup vertex buffer

void SetPolygonBuffer  )  [protected, inherited]
 

Setup polygon buffer

virtual const Coord& SetSize const Coord rkSize  )  [virtual, inherited]
 

Set size

Parameters:
rkSize Size
Returns:
New size

Reimplemented from Object.

unsigned int ProcessMsg Msg pkMsg  )  [virtual, inherited]
 

Process message

Parameters:
pkMsg Message object
Returns:
Message specific return code, 0 indicates message was unprocessed

Reimplemented from Object.

virtual void SetBackground const NeoEngine::MaterialPtr &  pkMat  )  [virtual, inherited]
 

Set background material

Parameters:
pkMat New material

virtual void SetTilingMode TILINGMODE  eMode,
int  iX = 1,
int  iY = 1
[virtual, inherited]
 

Set tiling parameters

Parameters:
eMode Tiling mode
iX Tiles in horizontal direction
iY Tiles in vertical direction

virtual void SetUVs const Coord rkOrigin,
const Coord rkRight,
const Coord rkBottom
[virtual, inherited]
 

Set UV coordinates for area corners, forming rectangle (possibly skewed) in texture space

Parameters:
rkOrigin Coordinate in texture for top-left corner of area
rkRight Coordinates in texture space (pixels) for top right corner
rkBottom Coordinates in texture space (pixels) for bottom left corner

virtual NeoEngine::MaterialPtr& GetBackground  )  [inline, virtual, inherited]
 

Returns:
Background material

void UpdateWorldCache bool  bRecurse = true  )  [protected, inherited]
 

Update world cache position and recurse on children if flag set

Parameters:
bRecurse Recursion flag

virtual const Coord& SetPosition const Coord rkPos  )  [virtual, inherited]
 

Set position relative parent

Parameters:
rkPos Position
Returns:
New relative position

const Coord& GetPosition  )  const [inherited]
 

Returns:
Position relative parent

const Coord& GetWorldPosition  )  [inherited]
 

Returns:
World position

const Coord& GetSize  )  const [inherited]
 

Returns:
Size

virtual void SetName const NeoEngine::HashString &  rstrName  )  [virtual, inherited]
 

Parameters:
rstrName New name

virtual const NeoEngine::HashString& GetName  )  const [virtual, inherited]
 

Returns:
Name

unsigned int GetID  )  const [inline, inherited]
 

Returns:
Object ID

virtual Object* GetParent  )  [virtual, inherited]
 

Returns:
Parent object

virtual Object* GetRoot  )  [virtual, inherited]
 

Returns:
Root object

virtual Object* GetObject const std::string &  rstrName  )  [virtual, inherited]
 

Search for a child object by name ("parent" for parent object, "root" for root object)

Parameters:
rstrName Name of object
Returns:
Matching child object, null if not found

virtual const std::vector< Object* >& GetChildObjects  )  const [virtual, inherited]
 

Get all child objects (no recursion)

Returns:
Vector with child objects

virtual void AttachObject Object pkObject  )  [virtual, inherited]
 

Attach window object

Parameters:
pkObject Object

virtual void DetachObject Object pkObject  )  [virtual, inherited]
 

Detach window object

Parameters:
pkObject Object

virtual void AttachToObject Object pkParent  )  [virtual, inherited]
 

Attach this object to new parent

Parameters:
pkParent Parent object

virtual void AddHook MsgHook pkMsgHook  )  [virtual, inherited]
 

Add a message hook object (hook object will be freed in dtor)

Parameters:
pkMsgHook Message hook object

virtual void RemoveHook MsgHook pkMsgHook  )  [virtual, inherited]
 

Remove a message hook object (you must now free the hook object yourself)

Parameters:
pkMsgHook Message hook object

virtual void Input const NeoEngine::InputEvent *  pkEvent  )  [virtual, inherited]
 

Process input

Parameters:
pkEvent Event

HITTESTRESULT HitTest const Coord rkCoord  )  [inherited]
 

Test if coordinate is inside, on edge or outside object area

Parameters:
rkCoord Coordinate to test
Returns:
Hit test identifier

virtual void Update float  fDeltaTime  )  [virtual, inherited]
 

Update object

Parameters:
fDeltaTime Deltatime passed since last update

Reimplemented in EditBox.


Member Data Documentation

NeoEngine::FontPtr m_pkFont [protected]
 

Font

Coord m_kPadding [protected]
 

Text padding

NeoEngine::Color m_kFontColor [protected]
 

Font color

std::string m_strText
 

Text

bool m_bPassword
 

Password

NeoEngine::MaterialPtr m_pkBackground [protected, inherited]
 

Background

NeoEngine::VertexBufferPtr m_pkVertexBuffer [protected, inherited]
 

Vertex buffer

NeoEngine::PolygonBufferPtr m_pkPolygonBuffer [protected, inherited]
 

Polygon buffer

NeoEngine::RenderPrimitive* m_pkRenderPrim [protected, inherited]
 

Render op object

TILINGMODE m_eTilingMode [protected, inherited]
 

Tiling mode

int m_aiNumTiles[2] [protected, inherited]
 

Number of tiles in each direction

Coord m_akUV[3] [protected, inherited]
 

UV coord vectors

unsigned int m_uiID [protected, inherited]
 

Unique ID

Object* m_pkParent [protected, inherited]
 

Parent object

std::vector< Object* > m_vpkChildren [protected, inherited]
 

Children

Coord m_kPos [protected, inherited]
 

Position relative parent

Coord m_kWorldPos [protected, inherited]
 

World position

Coord m_kSize [protected, inherited]
 

Size

NeoEngine::HashString m_strName [protected, inherited]
 

Name

std::vector< MsgHook* > m_vpkMsgHook [protected, inherited]
 

Hooked message actions

HITTESTRESULT m_eLastMouse [protected, inherited]
 

Result of last mouse hit test


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:20 2004 for NeoWTK by doxygen 1.3.5