[Cocos2d-x] source code analysis-2d/ui/UILayoutDefine. h

Source: Internet
Author: User

# 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 __)*/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.