ParaScripting::ParaUIGraphics Class Reference
[ParaUI]

List of all members.

Detailed Description

a GUI graphics object which contains 2D primitives.


Public Member Functions

 ParaUIGraphics (CGDIGraphics *obj)
bool IsValid () const
 check if the object is valid
void SetRenderTarget (ParaAssetObject pEntity)
 this will internally create the CGDIDC object from the render target texture.
ParaAssetObject GetRenderTarget ()
void Invalidate (bool bInvalidate)
 Invalidate the graphics, causing the entire render target to be redrawn at the next render call.
bool IsInvalidated () const
 whether it is invalidated
bool SaveAs (const char *filename)
 save the current texture to disk file.
bool LoadFromTexture (ParaAssetObject pTexture)
 load the texture from a disk image.The current graphics will be reset.
ParaAssetObject GetDiskTexture ()
 get the current disk texture.
void Render ()
 Do not call this function from scripting interface.
ParaUIPen GetCurrentPen ()
 get the current pen object
void SetCurrentPen (ParaUIPen pen)
 set the current pen object
ParaUIPen CreatePen (string name)
 create a new pen object in the pen pools
ParaUIPen GetPen (string name)
 get a new pen object in the pen pools
void Clear (const char *strColor)
 Clears the current render target of the CGDIGraphics.
void DrawLine (float x1, float y1, float x2, float y2)
 Draw a line with a specific pen, the operation is pending If point1=point2, a point will be drawn instead.
void DrawPoint (float x, float y)
 Draw a point with a specific pen, the operation is pending.
void Undo (int nStep)
 undo a certain amount of steps
void Redo (int nStep)
 redo a certain amount of steps
void Reset ()
 reset to be reused.

Public Attributes

CGDIGraphics * m_pObj


Member Function Documentation

void ParaScripting::ParaUIGraphics::SetRenderTarget ( ParaAssetObject  pEntity  ) 

this will internally create the CGDIDC object from the render target texture.

Parameters:
pEntity,: this must a render target texture

bool ParaScripting::ParaUIGraphics::SaveAs ( const char *  filename  ) 

save the current texture to disk file.

When we saved the current graphics to disk, we will also reset the graphics object to disk.

bool ParaScripting::ParaUIGraphics::LoadFromTexture ( ParaAssetObject  pTexture  ) 

load the texture from a disk image.The current graphics will be reset.

ParaAssetObject ParaScripting::ParaUIGraphics::GetDiskTexture (  ) 

get the current disk texture.

NULL may be returned.

void ParaScripting::ParaUIGraphics::Render (  ) 

Do not call this function from scripting interface.

unless you are aware of what you are doing. call Invalidate(true) instead. render to the current DC.

ParaScripting::ParaUIPen ParaScripting::ParaUIGraphics::GetCurrentPen (  ) 

get the current pen object

Returns:

void ParaScripting::ParaUIGraphics::SetCurrentPen ( ParaUIPen  pen  ) 

set the current pen object

Parameters:
pen 

ParaScripting::ParaUIPen ParaScripting::ParaUIGraphics::CreatePen ( string  name  ) 

create a new pen object in the pen pools

Parameters:
name 
Returns:
NULL may be returned if pen is not valid

void ParaScripting::ParaUIGraphics::Reset (  ) 

reset to be reused.

Nothing except the disk texture will be drawn.


Generated on Mon Dec 1 14:34:45 2008 for NPL Scripting Reference for ParaEngine by  doxygen 1.5.2