# Ifndef _ UILAYOUTDEFINE_H __# define _ UILAYOUTDEFINE_H __# include "cocos2d. h "NS_CC_BEGINnamespace ui {/*** gap between the control and the surrounding controls * after the gap is set, the size of the control is enlarged. * There is no distance between the control and the surrounding controls. **/class Margin {public: float left; float top; float right; float bottom; public: Margin (); Margin (float l, float t, float r, float B ); margin (const Margin & other); Margin & operator = (const Margin & other); void setMargin (float l, float t, float r, float B ); bool equals (const Margin & target) const ;}; const Margin MarginZero = Margin (); typedef enum {LINEAR_GRAVITY_NONE, LINEAR_GRAVITY_LEFT, // left Margin, // LINEAR_GRAVITY_RIGHT, // right LINEAR_GRAVITY_BOTTOM, // LINEAR_GRAVITY_CENTER_VERTICAL, // vertical LINEAR_GRAVITY_CENTER_HORIZONTAL // horizontal} LinearGravity; // linear gravity typedef enum {/** enumeration of 9 locations aligned with the parent node */RELATIVE_ALIGN_NONE, priority, // upper left corner, // RELATIVE_ALIGN_PARENT_TOP_RIGHT in the upper left corner, // upper right corner, // vertical left-side center RELATIVE_CENTER_IN_PARENT, // center area, // vertical right-side center area, // lower left corner, // horizontal bottom center RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM, // bottom right/** enumeration of 9 positions aligned around the sibling node */align, // top left relative_location_abve_center, // top relative_location_abve_rightalign, // top right align, // RELATIVE_LOCATION_LEFT_OF_CENTER on the left, // middle center on the left, // lower center on the left, // middle center on the Right of RELATIVE_LOCATION_RIGHT_OF_CENTER, // middle center on the right, // lower center on the right, // left RELATIVE_LOCATION_BELOW_CENTER at the bottom, // bottom right} RelativeAlign; // relatively align_cc_end # endif/* defined (_ UILayoutDefine __)*/