cocos2d-x  2.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
UIHelper Class Reference

#include <UIHelper.h>

Public Member Functions

 UIHelper ()
 ~UIHelper ()
 Default destructor. More...
 
void init ()
UIWidgetcreateWidgetFromJsonFile (const char *fileName)
 Load a widget with json file. More...
 
void addSpriteFrame (const char *fileName)
void removeSpriteFrame (const char *fileName)
void removeAllSpriteFrame ()
UIWidgetseekWidgetByTag (UIWidget *root, int tag)
 Finds a widget whose tag equals to param tag from root widget. More...
 

Static Public Member Functions

static UIHelperinstance ()
static void purgeUIHelper ()

name value.

Finds a widget whose name equals to param name from root widget.

RelativeLayout will call this method to find the widget witch is needed.

Parameters
rootwidget which will be seeked.
Returns
finded result.
float m_fFileDesignWidth
float m_fFileDesignHeight
CCArraym_textureFiles
UIWidgetseekWidgetByName (UIWidget *root, const char *name)
UIWidgetseekWidgetByRelativeName (UIWidget *root, const char *name)
void setFileDesignWidth (float width)
float getFileDesignWidth ()
void setFileDesignHeight (float height)
float getFileDesignHeight ()
UIWidgetseekActionWidgetByActionTag (UIWidget *root, int tag)

Constructor & Destructor Documentation

UIHelper ( )
~UIHelper ( )

Default destructor.

Member Function Documentation

void addSpriteFrame ( const char *  fileName)
UIWidget* createWidgetFromJsonFile ( const char *  fileName)

Load a widget with json file.

Returns
a widget created with json file.
float getFileDesignHeight ( )
float getFileDesignWidth ( )
void init ( )
static UIHelper* instance ( )
static
static void purgeUIHelper ( )
static
void removeAllSpriteFrame ( )
void removeSpriteFrame ( const char *  fileName)
UIWidget*
seekActionWidgetByActionTag
( UIWidget root,
int  tag 
)
UIWidget* seekWidgetByName ( UIWidget root,
const char *  name 
)
UIWidget* seekWidgetByRelativeName ( UIWidget root,
const char *  name 
)
UIWidget* seekWidgetByTag ( UIWidget root,
int  tag 
)

Finds a widget whose tag equals to param tag from root widget.

Parameters
rootwidget which will be seeked.

tag value.

Returns
finded result.
void setFileDesignHeight ( float  height)
void setFileDesignWidth ( float  width)

Member Data Documentation

float m_fFileDesignHeight
protected
float m_fFileDesignWidth
protected
CCArray* m_textureFiles
protected

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