Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Helper Class Reference

Helper class for traversing children in widget tree. More...

Static Public Member Functions

static WidgetseekWidgetByTag (Widget *root, int tag)
 Find a widget with a specific tag from root widget. More...
 
var seekWidgetByTag ( var root, var tag)
 Find a widget with a specific tag from root widget. More...
 
local seekWidgetByTag ( local root, local tag)
 Find a widget with a specific tag from root widget. More...
 
static WidgetseekWidgetByName (Widget *root, const std::string &name)
 Find a widget with a specific name from root widget. More...
 
local seekWidgetByName ( local root, local name)
 Find a widget with a specific name from root widget. More...
 
static WidgetseekActionWidgetByActionTag (Widget *root, int tag)
 Find a widget with a specific action tag from root widget This search will be recursive throught all child widgets. More...
 
local seekActionWidgetByActionTag ( local root, local tag)
 Find a widget with a specific action tag from root widget This search will be recursive throught all child widgets. More...
 
static std::string getSubStringOfUTF8String (const std::string &str, std::string::size_type start, std::string::size_type length)
 Get a UTF8 substring from a std::string with a given start position and length Sample: std::string str = "中国中国中国"; substr = getSubStringOfUTF8String(str,0,2) will = "中国". More...
 
local getSubStringOfUTF8String ( local str, local start, local length)
 Get a UTF8 substring from a std::string with a given start position and length Sample: std::string str = "中国中国中国"; substr = getSubStringOfUTF8String(str,0,2) will = "中国". More...
 
static void doLayout (Node *rootNode)
 Refresh object and it's children layout state. More...
 
static void changeLayoutSystemActiveState (bool active)
 Change the active property of Layout's A boolean value.
 
var changeLayoutSystemActiveState ( var active)
 Change the active property of Layout's A boolean value.
 
local changeLayoutSystemActiveState ( local active)
 Change the active property of Layout's A boolean value.
 
static Rect restrictCapInsetRect (const Rect &capInsets, const Size &textureSize)
 restrict capInsetSize, when the capInsets's width is larger than the textureSize, it will restrict to 0, the height goes the same way as width. More...
 
var restrictCapInsetRect ( var capInsets, var textureSize)
 restrict capInsetSize, when the capInsets's width is larger than the textureSize, it will restrict to 0, the height goes the same way as width. More...
 
local restrictCapInsetRect ( local capInsets, local textureSize)
 restrict capInsetSize, when the capInsets's width is larger than the textureSize, it will restrict to 0, the height goes the same way as width. More...
 
static Rect convertBoundingBoxToScreen (Node *node)
 Convert a node's boundingBox rect into screen coordinates. More...
 

Detailed Description

Helper class for traversing children in widget tree.

It also provides some helper functions for layout.

Member Function Documentation

static Widget* seekWidgetByTag ( Widget root,
int  tag 
)
static

Find a widget with a specific tag from root widget.

This search will be recursive through all child widgets. The be searched root widget. The widget tag. Widget instance pointer.

var seekWidgetByTag ( var  root,
var  tag 
)
static

Find a widget with a specific tag from root widget.

This search will be recursive through all child widgets. The be searched root widget. The widget tag. Widget instance pointer.

local seekWidgetByTag ( local  root,
local  tag 
)
static

Find a widget with a specific tag from root widget.

This search will be recursive through all child widgets. The be searched root widget. The widget tag. Widget instance pointer.

static Widget* seekWidgetByName ( Widget root,
const std::string &  name 
)
static

Find a widget with a specific name from root widget.

This search will be recursive through all child widgets.

The be searched root widget. The widget name. Widget instance pointer.

var seekWidgetByName ( var  root,
var  name 
)
static

Find a widget with a specific name from root widget.

This search will be recursive through all child widgets.

The be searched root widget. The widget name. Widget instance pointer.

local seekWidgetByName ( local  root,
local  name 
)
static

Find a widget with a specific name from root widget.

This search will be recursive through all child widgets.

The be searched root widget. The widget name. Widget instance pointer.

static Widget*
seekActionWidgetByActionTag
( Widget root,
int  tag 
)
static

Find a widget with a specific action tag from root widget This search will be recursive throught all child widgets.

The be searched root widget. The widget action's tag. Widget instance pointer.

var seekActionWidgetByActionTag ( var  root,
var  tag 
)
static

Find a widget with a specific action tag from root widget This search will be recursive throught all child widgets.

The be searched root widget. The widget action's tag. Widget instance pointer.

local seekActionWidgetByActionTag ( local  root,
local  tag 
)
static

Find a widget with a specific action tag from root widget This search will be recursive throught all child widgets.

The be searched root widget. The widget action's tag. Widget instance pointer.

static std::string
getSubStringOfUTF8String
( const std::string &  str,
std::string::size_type  start,
std::string::size_type  length 
)
static

Get a UTF8 substring from a std::string with a given start position and length Sample: std::string str = "中国中国中国"; substr = getSubStringOfUTF8String(str,0,2) will = "中国".

The source string. The start position of the substring. The length of the substring in UTF8 count a UTF8 substring

local getSubStringOfUTF8String ( local  str,
local  start,
local  length 
)
static

Get a UTF8 substring from a std::string with a given start position and length Sample: std::string str = "中国中国中国"; substr = getSubStringOfUTF8String(str,0,2) will = "中国".

The source string. The start position of the substring. The length of the substring in UTF8 count a UTF8 substring

static void doLayout ( Node rootNode)
static

Refresh object and it's children layout state.

A Node* or Node* descendant instance pointer.

var doLayout ( var  rootNode)
static

Refresh object and it's children layout state.

A Node* or Node* descendant instance pointer.

local doLayout ( local  rootNode)
static

Refresh object and it's children layout state.

A Node* or Node* descendant instance pointer.

static Rect restrictCapInsetRect ( const Rect capInsets,
const Size textureSize 
)
static

restrict capInsetSize, when the capInsets's width is larger than the textureSize, it will restrict to 0, the height goes the same way as width.

A user defined capInsets. The size of a scale9enabled texture a restricted capInset.

var restrictCapInsetRect ( var  capInsets,
var  textureSize 
)
static

restrict capInsetSize, when the capInsets's width is larger than the textureSize, it will restrict to 0, the height goes the same way as width.

A user defined capInsets. The size of a scale9enabled texture a restricted capInset.

local restrictCapInsetRect ( local  capInsets,
local  textureSize 
)
static

restrict capInsetSize, when the capInsets's width is larger than the textureSize, it will restrict to 0, the height goes the same way as width.

A user defined capInsets. The size of a scale9enabled texture a restricted capInset.

static Rect
convertBoundingBoxToScreen
( Node node)
static

Convert a node's boundingBox rect into screen coordinates.

Parameters
nodeAny node pointer.
Returns
A Rect in screen coordinates.
var convertBoundingBoxToScreen ( var  node)
static

Convert a node's boundingBox rect into screen coordinates.

Parameters
nodeAny node pointer.
Returns
A Rect in screen coordinates.
local convertBoundingBoxToScreen ( local  node)
static

Convert a node's boundingBox rect into screen coordinates.

Parameters
nodeAny node pointer.
Returns
A Rect in screen coordinates.

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