cocos2d-X 节点(UILayoutDefine.h)API

本文来自http://blog.csdn.net/runaying ,引用必须注明出处!

cocos2d-X 节点(UILayoutDefine.h)API

温馨提醒:为了大家能更好学习,强烈推荐大家看看本人的这篇博客 Cocos2d-X权威指南笔记

主要是一些定义,线性重力,相对对齐,和边距的设置

///cocos2d-x-3.0alpha0/extensions/CocoStudio/GUI/Layouts
// 主要是一些定义,线性重力,相对对齐,和边距的设置


#ifndef __UILAYOUTDEFINE_H__
#define __UILAYOUTDEFINE_H__

#include "cocos2d.h"
#include "ExtensionMacros.h"

NS_CC_EXT_BEGIN

class UIMargin
{
public:
    float left;
    float top;
    float right;
    float bottom;
    
public:
    UIMargin();
    UIMargin(float l, float t, float r, float b);
    UIMargin(const UIMargin& other);
    UIMargin& operator= (const UIMargin& other);
    void setMargin(float l, float t, float r, float b);
    bool equals(const UIMargin& target) const;
};


typedef enum
{
    LINEAR_GRAVITY_NONE,
    LINEAR_GRAVITY_LEFT,
    LINEAR_GRAVITY_TOP,
    LINEAR_GRAVITY_RIGHT,
    LINEAR_GRAVITY_BOTTOM,
    LINEAR_GRAVITY_CENTER_VERTICAL,
    LINEAR_GRAVITY_CENTER_HORIZONTAL
}UILinearGravity;

typedef enum
{
    RELATIVE_ALIGN_NONE,
    RELATIVE_ALIGN_PARENT_LEFT,
    RELATIVE_ALIGN_PARENT_TOP,
    RELATIVE_ALIGN_PARENT_RIGHT,
    RELATIVE_ALIGN_PARENT_BOTTOM,
    RELATIVE_CENTER_IN_PARENT,
    RELATIVE_CENTER_HORIZONTAL,
    RELATIVE_CENTER_VERTICAL,
    RELATIVE_LOCATION_LEFT_OF_TOPALIGN,
    RELATIVE_LOCATION_LEFT_OF_CENTER,
    RELATIVE_LOCATION_LEFT_OF_BOTTOMALIGN,
    RELATIVE_LOCATION_RIGHT_OF_TOPALIGN,
    RELATIVE_LOCATION_RIGHT_OF_CENTER,
    RELATIVE_LOCATION_RIGHT_OF_BOTTOMALIGN,
    RELATIVE_LOCATION_ABOVE_LEFTALIGN,
    RELATIVE_LOCATION_ABOVE_CENTER,
    RELATIVE_LOCATION_ABOVE_RIGHTALIGN,
    RELATIVE_LOCATION_BELOW_LEFTALIGN,
    RELATIVE_LOCATION_BELOW_CENTER,
    RELATIVE_LOCATION_BELOW_RIGHTALIGN
}UIRelativeAlign;

NS_CC_EXT_END

#endif /* defined(__UILayoutDefine__) */


你可能感兴趣的:(api,cocos2d,cocos2dx,cocos2d-x)