2013-11-18 16:54:52 +08:00
|
|
|
//
|
|
|
|
// cocos2d gui constants
|
|
|
|
//
|
|
|
|
// This helper file should be required after jsb_cocos2d.js
|
|
|
|
//
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
var ccui = ccui || {};
|
2013-11-18 16:54:52 +08:00
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.BrightStyle = {
|
2013-11-18 16:54:52 +08:00
|
|
|
none: -1,
|
|
|
|
normal: 0,
|
|
|
|
highlight: 1
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.WidgetType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
widget: 0, //control
|
|
|
|
container: 1 //container
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.TextureResType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
local: 0,
|
|
|
|
plist: 1
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.TouchEventType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
began: 0,
|
|
|
|
moved: 1,
|
|
|
|
ended: 2,
|
|
|
|
canceled: 3
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.SizeType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
absolute: 0,
|
|
|
|
percent: 1
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.PositionType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
absolute: 0,
|
|
|
|
percent: 1
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.CheckBoxEventType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
selected: 0,
|
|
|
|
unselected: 1
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.TextFiledEventType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
attach_with_me: 0,
|
|
|
|
detach_with_ime: 1,
|
|
|
|
insert_text: 2,
|
|
|
|
delete_backward: 3
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.LayoutBackGroundColorType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
none: 0,
|
|
|
|
solid: 1,
|
|
|
|
gradient: 2
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.LayoutType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
absolute: 0,
|
|
|
|
linearVertical: 1,
|
|
|
|
linearHorizontal: 2,
|
|
|
|
relative: 3
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.LayoutParameterType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
none: 0,
|
|
|
|
linear: 1,
|
|
|
|
relative: 2
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.LinearGravity = {
|
2013-11-18 16:54:52 +08:00
|
|
|
none: 0,
|
|
|
|
left: 1,
|
|
|
|
top: 2,
|
|
|
|
right: 3,
|
|
|
|
bottom: 4,
|
|
|
|
centerVertical: 5,
|
|
|
|
centerHorizontal: 6
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.RelativeAlign = {
|
2013-11-18 16:54:52 +08:00
|
|
|
alignNone: 0,
|
|
|
|
alignParentTopLeft: 1,
|
|
|
|
alignParentTopCenterHorizontal: 2,
|
|
|
|
alignParentTopRight: 3,
|
|
|
|
alignParentLeftCenterVertical: 4,
|
|
|
|
centerInParent: 5,
|
|
|
|
alignParentRightCenterVertical: 6,
|
|
|
|
alignParentLeftBottom: 7,
|
|
|
|
alignParentBottomCenterHorizontal: 8,
|
|
|
|
alignParentRightBottom: 9,
|
|
|
|
locationAboveLeftAlign: 10,
|
|
|
|
locationAboveCenter: 11,
|
|
|
|
locationAboveRightAlign: 12,
|
|
|
|
locationLeftOfTopAlign: 13,
|
|
|
|
locationLeftOfCenter: 14,
|
|
|
|
locationLeftOfBottomAlign: 15,
|
|
|
|
locationRightOfTopAlign: 16,
|
|
|
|
locationRightOfCenter: 17,
|
|
|
|
locationRightOfBottomAlign: 18,
|
|
|
|
locationBelowLeftAlign: 19,
|
|
|
|
locationBelowCenter: 20,
|
|
|
|
locationBelowRightAlign: 21
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.SliderEventType = {percent_changed: 0};
|
2013-11-18 16:54:52 +08:00
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.LoadingBarType = { left: 0, right: 1};
|
2013-11-18 16:54:52 +08:00
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.ScrollViewDir = {
|
2013-11-18 16:54:52 +08:00
|
|
|
none: 0,
|
|
|
|
vertical: 1,
|
|
|
|
horizontal: 2,
|
|
|
|
both: 3
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.ScrollviewEventType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
scrollToTop: 0,
|
|
|
|
scrollToBottom: 1,
|
|
|
|
scrollToLeft: 2,
|
|
|
|
scrollToRight: 3,
|
|
|
|
scrolling: 4,
|
|
|
|
bounceTop: 5,
|
|
|
|
bounceBottom: 6,
|
|
|
|
bounceLeft: 7,
|
|
|
|
bounceRight: 8
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.ListViewEventType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
init_child: 0,
|
|
|
|
update_child: 1
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.ListViewGravity = {
|
|
|
|
left: 0,
|
|
|
|
right: 1,
|
|
|
|
centerHorizontal: 2,
|
|
|
|
top: 3,
|
|
|
|
bottom: 4,
|
|
|
|
centerVertical: 5
|
|
|
|
};
|
|
|
|
|
|
|
|
ccui.PageViewEventType = {
|
2013-11-18 16:54:52 +08:00
|
|
|
turning: 0
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.PVTouchDir = {
|
2013-11-18 16:54:52 +08:00
|
|
|
touchLeft: 0,
|
|
|
|
touchRight: 1
|
|
|
|
};
|
|
|
|
|
2014-01-02 14:21:24 +08:00
|
|
|
ccui.Margin = cc.Class.extend({
|
2013-11-18 16:54:52 +08:00
|
|
|
left: 0,
|
|
|
|
top: 0,
|
|
|
|
right: 0,
|
|
|
|
bottom: 0,
|
|
|
|
ctor: function () {
|
|
|
|
if (arguments.length == 1) {
|
|
|
|
var uiMargin = arguments[0];
|
|
|
|
this.left = uiMargin.left;
|
|
|
|
this.top = uiMargin.top;
|
|
|
|
this.right = uiMargin.right;
|
|
|
|
this.bottom = uiMargin.bottom;
|
|
|
|
}
|
|
|
|
if (arguments.length == 4) {
|
|
|
|
this.left = arguments[0];
|
|
|
|
this.top = arguments[1];
|
|
|
|
this.right = arguments[2];
|
|
|
|
this.bottom = arguments[3];
|
|
|
|
}
|
|
|
|
},
|
|
|
|
setMargin: function (l, t, r, b) {
|
|
|
|
this.left = l;
|
|
|
|
this.top = t;
|
|
|
|
this.right = r;
|
|
|
|
this.bottom = b;
|
|
|
|
},
|
|
|
|
equals: function (target) {
|
|
|
|
return (this.left == target.left && this.top == target.top && this.right == target.right && this.bottom == target.bottom);
|
|
|
|
}
|
|
|
|
});
|