cocos2d-js 枚举——ccui

cocos2d-js中 cc.xxx枚举

/**
 * 文本水平对齐方式
 */
cc.TEXT_ALIGNMENT_CENTER    = 1;
cc.TEXT_ALIGNMENT_RIGHT     = 2;
cc.TEXT_ALIGNMENT_LEFT      = 0;

/**
 * 文本垂直对齐方式
 */
cc.VERTICAL_TEXT_ALIGNMENT_TOP      = 0;
cc.VERTICAL_TEXT_ALIGNMENT_CENTER   = 1;
cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM   = 2;

cocos2d-js中 ccui.xxx枚举

/*
 * UILayout.h -> "enum class BackGroundColorType"
 * UILayout的背景颜色类型,默认为NONE。
 */
ccui.Layout.BG_COLOR_NONE = 0;      无色
ccui.Layout.BG_COLOR_SOLID = 1;     纯色
ccui.Layout.BG_COLOR_GRADIENT = 2;  渐变色

/**
 * UILayout.h -> "enum class Type"
 * UILayout布局类型,默认为ABSOLUTE。     
 */
ccui.Layout.ABSOLUTE = 0;           绝对布局
ccui.Layout.LINEAR_VERTICAL = 1;    垂直布局
ccui.Layout.LINEAR_HORIZONTAL = 2;  水平布局
ccui.Layout.RELATIVE = 3;           相对布局

/**
 * UILayout.h -> "enum class ClippingType"
 * 裁剪模式
 */
ccui.Layout.CLIPPING_STENCIL = 0;            模板裁剪 类似于UILayout的裁剪模式(使用的模板缓冲,所以无论控件的矩阵怎么样变换,都可以完美的进行裁切)
ccui.Layout.CLIPPING_SCISSOR = 1;            剪刀裁剪 类似于ScrollView、ListView的裁剪模式(直接使用矩阵进行计算,效率比较高,但是目前还不能很好的支持旋转和缩放)
ccui.Layout.BACKGROUND_IMAGE_ZORDER = -1;    背景图片渲染
ccui.Layout.BACKGROUND_RENDERER_ZORDER = -2; 背景渲染器渲染

/*
 * UILayoutParameter.h -> "enum class LinearGravity"
 * 线性布局枚举
 */
// 旧
ccui.LINEAR_GRAVITY_NONE = 0;
ccui.LINEAR_GRAVITY_LEFT = 1;
ccui.LINEAR_GRAVITY_TOP = 2;
ccui.LINEAR_GRAVITY_RIGHT = 3;
ccui.LINEAR_GRAVITY_BOTTOM = 4;
ccui.LINEAR_GRAVITY_CENTER_VERTICAL = 5;
ccui.LINEAR_GRAVITY_CENTER_HORIZONTAL = 6;
// 新
ccui.LinearLayoutParameter.NONE = 0;
ccui.LinearLayoutParameter.LEFT = 1;
ccui.LinearLayoutParameter.TOP = 2;
ccui.LinearLayoutParameter.RIGHT = 3;
ccui.LinearLayoutParameter.BOTTOM = 4;
ccui.LinearLayoutParameter.CENTER_VERTICAL = 5;
ccui.LinearLayoutParameter.CENTER_HORIZONTAL = 6;

/**
 * UILayoutParameter.h -> "enum class RelativeAlign"
 * 相对对齐类型
 */
// 旧
ccui.RELATIVE_ALIGN_NONE = 0;
ccui.RELATIVE_ALIGN_PARENT_TOP_LEFT = 1;
ccui.RELATIVE_ALIGN_PARENT_TOP_CENTER_HORIZONTAL = 2;
ccui.RELATIVE_ALIGN_PARENT_TOP_RIGHT = 3;
ccui.RELATIVE_ALIGN_PARENT_LEFT_CENTER_VERTICAL = 4;
ccui.RELATIVE_ALIGN_PARENT_CENTER = 5;
ccui.RELATIVE_ALIGN_PARENT_RIGHT_CENTER_VERTICAL = 6;
ccui.RELATIVE_ALIGN_PARENT_LEFT_BOTTOM = 7;
ccui.RELATIVE_ALIGN_PARENT_BOTTOM_CENTER_HORIZONTAL = 8;
ccui.RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM = 9;

ccui.RELATIVE_ALIGN_LOCATION_ABOVE_LEFT = 10;
ccui.RELATIVE_ALIGN_LOCATION_ABOVE_CENTER = 11;
ccui.RELATIVE_ALIGN_LOCATION_ABOVE_RIGHT = 12;

ccui.RELATIVE_ALIGN_LOCATION_LEFT_TOP = 13;
ccui.RELATIVE_ALIGN_LOCATION_LEFT_CENTER = 14;
ccui.RELATIVE_ALIGN_LOCATION_LEFT_BOTTOM = 15;

ccui.RELATIVE_ALIGN_LOCATION_RIGHT_TOP = 16;
ccui.RELATIVE_ALIGN_LOCATION_RIGHT_CENTER = 17;
ccui.RELATIVE_ALIGN_LOCATION_RIGHT_BOTTOM = 18;

ccui.RELATIVE_ALIGN_LOCATION_BELOW_TOP = 19;
ccui.RELATIVE_ALIGN_LOCATION_BELOW_CENTER = 20;
ccui.RELATIVE_ALIGN_LOCATION_BELOW_BOTTOM = 21;

// 新
ccui.RelativeLayoutParameter.NONE = 0;
ccui.RelativeLayoutParameter.PARENT_TOP_LEFT = 1;
ccui.RelativeLayoutParameter.PARENT_TOP_CENTER_HORIZONTAL = 2;
ccui.RelativeLayoutParameter.PARENT_TOP_RIGHT = 3;
ccui.RelativeLayoutParameter.PARENT_LEFT_CENTER_VERTICAL = 4;

ccui.RelativeLayoutParameter.CENTER_IN_PARENT = 5;

ccui.RelativeLayoutParameter.PARENT_RIGHT_CENTER_VERTICAL = 6;
ccui.RelativeLayoutParameter.PARENT_LEFT_BOTTOM = 7;
ccui.RelativeLayoutParameter.PARENT_BOTTOM_CENTER_HORIZONTAL = 8;
ccui.RelativeLayoutParameter.PARENT_RIGHT_BOTTOM = 9;

ccui.RelativeLayoutParameter.LOCATION_ABOVE_LEFTALIGN = 10;
ccui.RelativeLayoutParameter.LOCATION_ABOVE_CENTER = 11;
ccui.RelativeLayoutParameter.LOCATION_ABOVE_RIGHTALIGN = 12;
ccui.RelativeLayoutParameter.LOCATION_LEFT_OF_TOPALIGN = 13;
ccui.RelativeLayoutParameter.LOCATION_LEFT_OF_CENTER = 14;
ccui.RelativeLayoutParameter.LOCATION_LEFT_OF_BOTTOMALIGN = 15;
ccui.RelativeLayoutParameter.LOCATION_RIGHT_OF_TOPALIGN = 16;
ccui.RelativeLayoutParameter.LOCATION_RIGHT_OF_CENTER = 17;
ccui.RelativeLayoutParameter.LOCATION_RIGHT_OF_BOTTOMALIGN = 18;
ccui.RelativeLayoutParameter.LOCATION_BELOW_LEFTALIGN = 19;
ccui.RelativeLayoutParameter.LOCATION_BELOW_CENTER = 20;
ccui.RelativeLayoutParameter.LOCATION_BELOW_RIGHTALIGN = 21;

/*
 * UILayoutParameter.h -> "enum class Type"
 * 布局参数类型
 */
ccui.LayoutParameter.NONE = 0;      无布局参数类型
ccui.LayoutParameter.LINEAR = 1;    元素将按边缘排列。
ccui.LayoutParameter.RELATIVE = 2;  元素将按边距和相关的部件名称进行排列。

/*
 * UILayoutComponent.h -> "enum class HorizontalEdge"
 * 部件水平和垂直方向的布局样式
 */
ccui.LayoutComponent.horizontalEdge = {};
ccui.LayoutComponent.horizontalEdge.NONE = 0;
ccui.LayoutComponent.horizontalEdge.LEFT = 1;
ccui.LayoutComponent.horizontalEdge.RIGHT = 2;
ccui.LayoutComponent.horizontalEdge.CENTER = 3;

ccui.LayoutComponent.verticalEdge = {};
ccui.LayoutComponent.verticalEdge.NONE = 0;
ccui.LayoutComponent.verticalEdge.BOTTOM = 1;
ccui.LayoutComponent.verticalEdge.TOP = 2;
ccui.LayoutComponent.verticalEdge.CENTER = 3;

/*
 * UIWidget.h -> "enum class BrightStyle"
 * 明亮风格
 */
ccui.Widget.BRIGHT_STYLE_NONE = -1;         无风格
ccui.Widget.BRIGHT_STYLE_NORMAL = 0;        默认
ccui.Widget.BRIGHT_STYLE_HIGH_LIGHT = 1;    高亮

/**
 * 小部件类型
 */
ccui.Widget.TYPE_WIDGET = 0;        小部件类型
ccui.Widget.TYPE_CONTAINER = 1;     容器类型

/**
 * UIWidget.h -> "enum class TextureResType"
 * 纹理资源类型
 */
ccui.Widget.LOCAL_TEXTURE = 0;  本地图片
ccui.Widget.PLIST_TEXTURE = 1;  Plist文件中的图片

/**
 * UIWidget.h -> "typedef enum TouchEventType"
 * 触摸类型
 */
ccui.Widget.TOUCH_BEGAN = 0;
ccui.Widget.TOUCH_MOVED = 1;
ccui.Widget.TOUCH_ENDED = 2;
ccui.Widget.TOUCH_CANCELED = 3;

/**
 * UIWidget.h -> "enum class SizeType"
 * 尺寸类型 
 */
ccui.Widget.SIZE_ABSOLUTE = 0;  绝对值
ccui.Widget.SIZE_PERCENT = 1;   百分值

//position type
/**
 * UIWidget.h -> "enum class PositionType" 
 * 坐标类型 
 */
ccui.Widget.POSITION_ABSOLUTE = 0;  绝对值
ccui.Widget.POSITION_PERCENT = 1;   百分值

/**
 * UIWidget.h -> "enum class FocusDirection" 
 * 焦点位置
 */
ccui.Widget.LEFT = 0;   
ccui.Widget.RIGHT = 1;
ccui.Widget.UP = 2;
ccui.Widget.DOWN = 3;

/*
 * UIListView.h -> "enum class EventType"
 * ListView元素项单击事件。 
 */
ccui.ListView.EVENT_SELECTED_ITEM = 0;      默认
ccui.ListView.ON_SELECTED_ITEM_START = 0;   开始点击
ccui.ListView.ON_SELECTED_ITEM_END = 1;     结束点击

/**
 * UIListView.h -> "enum class Gravity"
 */
ccui.ListView.GRAVITY_LEFT = 0;
ccui.ListView.GRAVITY_RIGHT = 1;
ccui.ListView.GRAVITY_CENTER_HORIZONTAL = 2;
ccui.ListView.GRAVITY_TOP = 3;
ccui.ListView.GRAVITY_BOTTOM = 4;
ccui.ListView.GRAVITY_CENTER_VERTICAL = 5;

/*
 * UIScrollView.h -> "enum class Direction"
 * ScrollView滚动方向   
 */
ccui.ScrollView.DIR_NONE = 0;           不支持滚动
ccui.ScrollView.DIR_VERTICAL = 1;       垂直方向滚动
ccui.ScrollView.DIR_HORIZONTAL = 2;     水平方向滚动
ccui.ScrollView.DIR_BOTH = 3;           支持两个方向滚动

/*
 * UIScrollView.h -> "typedef enum ScrollviewEventType"
 * ScrollView滚动事件类型 
 * ccui.ScrollView.EVENT_BOUNCE_RIGHT       
 */
ccui.ScrollView.EVENT_SCROLL_TO_TOP = 0;        往上滚动
ccui.ScrollView.EVENT_SCROLL_TO_BOTTOM = 1;     往下滚动
ccui.ScrollView.EVENT_SCROLL_TO_LEFT = 2;       往左滚动
ccui.ScrollView.EVENT_SCROLL_TO_RIGHT = 3;      往右滚动
ccui.ScrollView.EVENT_SCROLLING = 4;            滚动中
ccui.ScrollView.EVENT_BOUNCE_TOP = 5;           往上回弹
ccui.ScrollView.EVENT_BOUNCE_BOTTOM = 6;        往下回弹
ccui.ScrollView.EVENT_BOUNCE_LEFT = 7;          往左回弹
ccui.ScrollView.EVENT_BOUNCE_RIGHT = 8;         往右回弹

ccui.ScrollView.AUTO_SCROLL_MAX_SPEED = 1000;   最大滚动速度
ccui.ScrollView.SCROLLDIR_UP = cc.p(0, 1);      
ccui.ScrollView.SCROLLDIR_DOWN = cc.p(0, -1);   
ccui.ScrollView.SCROLLDIR_LEFT = cc.p(-1, 0);
ccui.ScrollView.SCROLLDIR_RIGHT = cc.p(1, 0);

/**
 * UIPageView.h -> "enum class EventType"
 * 交互事件
 */
ccui.PageView.EVENT_TURNING = 0;    拖拽

/**
 * UIPageView.h -> "enum class TouchDirection"
 * 拖动方向
 */
ccui.PageView.TOUCH_DIR_LEFT = 0;
ccui.PageView.TOUCH_DIR_RIGHT = 1;
ccui.PageView.TOUCH_DIR_UP = 2;
ccui.PageView.TOUCH_DIR_DOWN = 3;

/**
 * 滚动方向
 */
ccui.PageView.DIRECTION_HORIZONTAL = 0;
ccui.PageView.DIRECTION_VERTICAL = 1;

/*
 * UIButton
 * 渲染方式     
 */
ccui.NORMAL_RENDERER_ZORDER = -2;       普通渲染
ccui.PRESSED_RENDERER_ZORDER = -2;      压缩渲染
ccui.DISABLED_RENDERER_ZORDER = -2;     禁用渲染
ccui.TITLE_RENDERER_ZORDER = -1;        标题渲染

/**
 * 九宫格位置
   1 2 3
   4 5 6
   7 8 9
 */
ccui.Scale9Sprite.POSITIONS_CENTRE          
ccui.Scale9Sprite.POSITIONS_TOP             
ccui.Scale9Sprite.POSITIONS_LEFT            
ccui.Scale9Sprite.POSITIONS_RIGHT           
ccui.Scale9Sprite.POSITIONS_BOTTOM          
ccui.Scale9Sprite.POSITIONS_TOPRIGHT        
ccui.Scale9Sprite.POSITIONS_TOPLEFT
ccui.Scale9Sprite.POSITIONS_BOTTOMRIGHT
ccui.Scale9Sprite.POSITIONS_BOTTOMLEFT 

/*
 * UICheckBox.h -> "enum class EventType"
 * 选中事件
 */
ccui.CheckBox.EVENT_SELECTED = 0;       选中
ccui.CheckBox.EVENT_UNSELECTED = 1;     未选中

ccui.CheckBox.BOX_RENDERER_ZORDER = -1;                     
ccui.CheckBox.BOX_SELECTED_RENDERER_ZORDER = -1;            
ccui.CheckBox.BOX_DISABLED_RENDERER_ZORDER = -1;            
ccui.CheckBox.FRONT_CROSS_RENDERER_ZORDER = -1;             
ccui.CheckBox.FRONT_CROSS_DISABLED_RENDERER_ZORDER = -1;    

/*
 * UIImageView
 */
ccui.ImageView.RENDERER_ZORDER = -1;

/*
 * UILoadingBar.h -> "enum class Direction"
 * 进度条进度方向
 */
ccui.LoadingBar.TYPE_LEFT = 0;  从左往右
ccui.LoadingBar.TYPE_RIGHT = 1; 从右往左

ccui.LoadingBar.RENDERER_ZORDER = -1;

/*
 * UIRichElement
 */
//Rich element type
//ccui.RichElement.TYPE_TEXT = 0;
//ccui.RichElement.TYPE_IMAGE = 1;
//ccui.RichElement.TYPE_CUSTOM = 2;

/*
 * UISlider.h -> "enum class EventType"
 * 交互事件
 */
ccui.Slider.EVENT_PERCENT_CHANGED = 0;      百分比已更改
ccui.Slider.EVENT_SLIDEBALL_DOWN = 1;       事件滑块下降
ccui.Slider.EVENT_SLIDEBALL_UP = 2;         事件滑块上升
ccui.Slider.EVENT_SLIDEBALL_CANCEL = 3;     事件滑块取消

/*
 * UISlider渲染
 */
ccui.Slider.BASEBAR_RENDERER_ZORDER = -3;
ccui.Slider.PROGRESSBAR_RENDERER_ZORDER = -2;
ccui.Slider.BALL_RENDERER_ZORDER = -1;

/*
 * UIText渲染
 */
ccui.Text.RENDERER_ZORDER = -1;

/*
 * UITextAtlas渲染
 */
ccui.TextAtlas.RENDERER_ZORDER = -1;

/*
 * UITextBMFont渲染
 */
ccui.TextBMFont.RENDERER_ZORDER = -1;

/*
 * UITextField.h -> "typedef enum TextFiledEventType"
 * 交互事件
 */
ccui.TextField.EVENT_ATTACH_WITH_IME = 0;   弹出键盘
ccui.TextField.EVENT_DETACH_WITH_IME = 1;   收起键盘
ccui.TextField.EVENT_INSERT_TEXT = 2;       输入字符
ccui.TextField.EVENT_DELETE_BACKWARD = 3;   回退字符

ccui.TextField.RENDERER_ZORDER = -1;

/*
 * UIRadioButton.h -> "RadioButton" -> "enum class EventType"
 * 交互事件
 */
ccui.RadioButton.EVENT_SELECTED = 0;            选中
ccui.RadioButton.EVENT_UNSELECTED = 1;          未选中

/*
 * UIRadioButton.h -> "RadioButtonGroup" -> "enum class EventType"
 * 交互事件
 */
ccui.RadioButtonGroup.EVENT_SELECT_CHANGED = 0; 选中状态改变

你可能感兴趣的:(Cocos2d)