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

#include <UILayoutComponent.h>

Inheritance diagram for LayoutComponent:
Component Ref

Public Types

enum  ReferencePoint { BOTTOM_LEFT, TOP_LEFT, BOTTOM_RIGHT, TOP_RIGHT }
 When a node has a ReferencePositoin with value equals LEFT_BOTTOM, it will treat the left bottom corner of its parent as the origin(0,0) when positioning itself which is the same as cocos2d-x does. More...
 

Public Member Functions

 LayoutComponent ()
 LayoutComponent ()
 LayoutComponent ()
 ~LayoutComponent ()
 ~LayoutComponent ()
virtual bool init () override
local init ()
 CREATE_FUNC (LayoutComponent)
 CREATE_FUNC ( local LayoutComponent)
bool isUsingPercentPosition ()
void setUsingPercentPosition (bool flag)
local setUsingPercentPosition ( local flag)
const Vec2getPercentPosition ()
local getPercentPosition ()
void setPercentPosition (const Vec2 &percent)
local setPercentPosition ( local percent)
const Vec2getRelativePosition ()
local getRelativePosition ()
void setRelativePosition (const Vec2 &position)
local setRelativePosition ( local position)
void setReferencePoint (ReferencePoint point)
var setReferencePoint ( var point)
local setReferencePoint ( local point)
ReferencePoint getReferencePoint ()
var getReferencePoint ()
local getReferencePoint ()
const Vec2getOwnerPosition () const
local getOwnerPosition ()
void setOwnerPosition (const Vec2 &point)
local setOwnerPosition ( local point)
Vec2 getOwnerContentSize () const
var getOwnerContentSize ()
local getOwnerContentSize ()
void setOwnerContentSize (const Vec2 &size)
local setOwnerContentSize ( local size)
const Vec2getPercentContentSize () const
var getPercentContentSize ()
local getPercentContentSize ()
void setPercentContentSize (const Vec2 &percent)
local setPercentContentSize ( local percent)
bool isUsingPercentContentSize ()
var isUsingPercentContentSize ()
local isUsingPercentContentSize ()
void setUsingPercentContentSize (bool flag)
local setUsingPercentContentSize ( local flag)
void setActiveEnable (bool enable)
local setActiveEnable ( local enable)
- Public Member Functions inherited from Component
virtual ~Component (void)
virtual void onEnter ()
virtual void onExit ()
virtual void update (float delta)
virtual bool serialize (void *r)
virtual bool isEnabled () const
virtual void setEnabled (bool b)
const std::string & getName () const
void setName (const std::string &name)
void setOwner (Node *pOwner)
NodegetOwner () const
- 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 ()

Additional Inherited Members

- Static Public Member Functions inherited from Component
static Componentcreate (void)
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
- Protected Attributes inherited from Component
Node_owner
std::string _name
bool _enabled
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 

Member Enumeration Documentation

enum ReferencePoint
strong

When a node has a ReferencePositoin with value equals LEFT_BOTTOM, it will treat the left bottom corner of its parent as the origin(0,0) when positioning itself which is the same as cocos2d-x does.

But you can change it by assigning a different ReferencePosition. For example: If you use ReferencePosition with value equals RIGHT_TOP, then it will treat the right top corner of its parent as the origin(0,0) when positioning itself.

Enumerator
BOTTOM_LEFT 
TOP_LEFT 
BOTTOM_RIGHT 
TOP_RIGHT 
var ReferencePoint
strong

When a node has a ReferencePositoin with value equals LEFT_BOTTOM, it will treat the left bottom corner of its parent as the origin(0,0) when positioning itself which is the same as cocos2d-x does.

But you can change it by assigning a different ReferencePosition. For example: If you use ReferencePosition with value equals RIGHT_TOP, then it will treat the right top corner of its parent as the origin(0,0) when positioning itself.

Enumerator
BOTTOM_LEFT 
TOP_LEFT 
BOTTOM_RIGHT 
TOP_RIGHT 
local ReferencePoint
strong

When a node has a ReferencePositoin with value equals LEFT_BOTTOM, it will treat the left bottom corner of its parent as the origin(0,0) when positioning itself which is the same as cocos2d-x does.

But you can change it by assigning a different ReferencePosition. For example: If you use ReferencePosition with value equals RIGHT_TOP, then it will treat the right top corner of its parent as the origin(0,0) when positioning itself.

Enumerator
BOTTOM_LEFT 
TOP_LEFT 
BOTTOM_RIGHT 
TOP_RIGHT 

Constructor & Destructor Documentation

var LayoutComponent ( )
local LayoutComponent ( )
var ~LayoutComponent ( )
local ~LayoutComponent ( )

Member Function Documentation

CREATE_FUNC ( LayoutComponent  )
var CREATE_FUNC ( var  )
local CREATE_FUNC ( local  )
Vec2 getOwnerContentSize ( ) const
var getOwnerContentSize ( )
local getOwnerContentSize ( )
const Vec2& getOwnerPosition ( ) const
var getOwnerPosition ( )
local getOwnerPosition ( )
const Vec2& getPercentContentSize ( ) const
var getPercentContentSize ( )
local getPercentContentSize ( )
const Vec2& getPercentPosition ( )
var getPercentPosition ( )
local getPercentPosition ( )
ReferencePoint getReferencePoint ( )
var getReferencePoint ( )
local getReferencePoint ( )
const Vec2& getRelativePosition ( )
var getRelativePosition ( )
local getRelativePosition ( )
virtual bool init ( )
overridevirtual

Reimplemented from Component.

var init ( )
overridevirtual

Reimplemented from Component.

local init ( )
overridevirtual

Reimplemented from Component.

bool isUsingPercentContentSize ( )
var isUsingPercentContentSize ( )
local isUsingPercentContentSize ( )
bool isUsingPercentPosition ( )
void setActiveEnable ( bool  enable)
var setActiveEnable ( var  enable)
local setActiveEnable ( local  enable)
void setOwnerContentSize ( const Vec2 size)
var setOwnerContentSize ( var  size)
local setOwnerContentSize ( local  size)
void setOwnerPosition ( const Vec2 point)
var setOwnerPosition ( var  point)
local setOwnerPosition ( local  point)
void setPercentContentSize ( const Vec2 percent)
var setPercentContentSize ( var  percent)
local setPercentContentSize ( local  percent)
void setPercentPosition ( const Vec2 percent)
var setPercentPosition ( var  percent)
local setPercentPosition ( local  percent)
void setReferencePoint ( ReferencePoint  point)
var setReferencePoint ( var  point)
local setReferencePoint ( local  point)
void setRelativePosition ( const Vec2 position)
var setRelativePosition ( var  position)
local setRelativePosition ( local  position)
void setUsingPercentContentSize ( bool  flag)
var setUsingPercentContentSize ( var  flag)
local setUsingPercentContentSize ( local  flag)
void setUsingPercentPosition ( bool  flag)
var setUsingPercentPosition ( var  flag)
local setUsingPercentPosition ( local  flag)

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