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 ()
 
virtual bool init () override
 
 CREATE_FUNC (LayoutComponent)
 
bool isUsingPercentPosition ()
 
void setUsingPercentPosition (bool flag)
 
const Vec2getPercentPosition ()
 
void setPercentPosition (const Vec2 &percent)
 
const Vec2getRelativePosition ()
 
void setRelativePosition (const Vec2 &position)
 
void setReferencePoint (ReferencePoint point)
 
ReferencePoint getReferencePoint ()
 
const Vec2getOwnerPosition () const
 
void setOwnerPosition (const Vec2 &point)
 
Vec2 getOwnerContentSize () const
 
void setOwnerContentSize (const Vec2 &size)
 
const Vec2getPercentContentSize () const
 
void setPercentContentSize (const Vec2 &percent)
 
bool isUsingPercentContentSize ()
 
void setUsingPercentContentSize (bool flag)
 
void setActiveEnable (bool enable)
 
- Public Member Functions inherited from Component
virtual ~Component (void)
 NA NA More...
 
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 ()
 NA NA More...
 

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 

Constructor & Destructor Documentation

Member Function Documentation

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

Reimplemented from Component.

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

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