Cocos2d-x  v4
LayoutParameter Class Reference

Base class for various LayoutParameter. More...

Inherits Ref.

Inherited by LinearLayoutParameter, and RelativeLayoutParameter.

Public Types

enum  Type
 Layout parameter type. More...
 

Public Member Functions

 LayoutParameter ()
 Default constructor. More...
 
virtual ~LayoutParameter ()
 Default destructor. More...
 
void setMargin (const Margin &margin)
 Set margin parameter for LayoutParameter. More...
 
const MargingetMargin () const
 Gets margin parameter of LayoutParameter. More...
 
Type getLayoutType () const
 Gets LayoutParameterType of LayoutParameter. More...
 
LayoutParameterclone ()
 Create a copy of original LayoutParameter. More...
 
virtual LayoutParametercreateCloneInstance ()
 Create a cloned instance of LayoutParameter. More...
 
virtual void copyProperties (LayoutParameter *model)
 Copy all the member field from argument LayoutParameter to self. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Static Public Member Functions

static LayoutParametercreate ()
 Create a empty LayoutParameter. More...
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

Base class for various LayoutParameter.

Member Enumeration Documentation

◆ Type

enum Type
strong

Layout parameter type.

There are mainly two types:

  • Linear: Elements will be arranged by margin.
  • Relative: Elements will be arranged by margin and relative widget name.

Constructor & Destructor Documentation

◆ LayoutParameter()

LayoutParameter ( )
inline

Default constructor.

@lua new

◆ ~LayoutParameter()

virtual ~LayoutParameter ( )
inlinevirtual

Default destructor.

@lua NA

Member Function Documentation

◆ create()

static LayoutParameter* create ( )
static

Create a empty LayoutParameter.

Returns
A autorelease LayoutParameter instance.

◆ setMargin()

void setMargin ( const Margin margin)

Set margin parameter for LayoutParameter.

See also
Margin
Parameters
margin

◆ getMargin()

const Margin& getMargin ( ) const

Gets margin parameter of LayoutParameter.

See also
Margin
Returns
Margin of layout parameter.

◆ getLayoutType()

Type getLayoutType ( ) const

Gets LayoutParameterType of LayoutParameter.

See also
LayoutParameterType.
Returns
LayoutParameterType

◆ clone()

LayoutParameter* clone ( )

Create a copy of original LayoutParameter.

Returns
A LayoutParameter pointer.

◆ createCloneInstance()

virtual LayoutParameter* createCloneInstance ( )
virtual

Create a cloned instance of LayoutParameter.

Returns
A LayoutParameter pointer.

Reimplemented in RelativeLayoutParameter, and LinearLayoutParameter.

◆ copyProperties()

virtual void copyProperties ( LayoutParameter model)
virtual

Copy all the member field from argument LayoutParameter to self.

Parameters
modelA LayoutParameter instance.

Reimplemented in RelativeLayoutParameter, and LinearLayoutParameter.


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