optimization shader and tooltip for #fireball/issues/4771

This commit is contained in:
knoxHuang
2016-12-19 18:19:18 +08:00
parent 26d657fffc
commit bd8127aff7
28 changed files with 307 additions and 307 deletions
+2
View File
@@ -353,6 +353,8 @@ if (CC_DEV) {
"4100": "Property padding is deprecated, please use paddingLeft, paddingRight, paddingTop and paddingBottom instead", //padding
//Mask: 4200
"4200": "MaskType: IMAGE_STENCIL only support WebGL mode.", //onEnable
"4201": "The alphaThreshold invalid in Canvas Mode.", // alphaThreshold
"4202": "The inverted invalid in Canvas Mode.", // inverted
//PageView: 4300
"4300": "can not found the %s page.", //removePage
//RichText: 4400
+1 -1
View File
@@ -37,7 +37,7 @@ var Collider = cc.Class({
editing: {
default: false,
serializable: false,
tooltip: 'i18n:COMPONENT.collider.editing'
tooltip: CC_DEV && 'i18n:COMPONENT.collider.editing'
},
/**
+3 -3
View File
@@ -119,7 +119,7 @@ var Animation = cc.Class({
this.addClip(value);
},
tooltip: 'i18n:COMPONENT.animation.default_clip'
tooltip: CC_DEV && 'i18n:COMPONENT.animation.default_clip'
},
/**
@@ -149,7 +149,7 @@ var Animation = cc.Class({
_clips: {
default: [],
type: [AnimationClip],
tooltip: 'i18n:COMPONENT.animation.clips',
tooltip: CC_DEV && 'i18n:COMPONENT.animation.clips',
visible: true
},
@@ -162,7 +162,7 @@ var Animation = cc.Class({
*/
playOnLoad: {
default: false,
tooltip: 'i18n:COMPONENT.animation.play_on_load'
tooltip: CC_DEV && 'i18n:COMPONENT.animation.play_on_load'
}
},
+5 -5
View File
@@ -98,7 +98,7 @@ var AudioSource = cc.Class({
}
},
url: cc.AudioClip,
tooltip: 'i18n:COMPONENT.audio.clip',
tooltip: CC_DEV && 'i18n:COMPONENT.audio.clip',
animatable: false
},
@@ -126,7 +126,7 @@ var AudioSource = cc.Class({
}
return value;
},
tooltip: 'i18n:COMPONENT.audio.volume'
tooltip: CC_DEV && 'i18n:COMPONENT.audio.volume'
},
/**
@@ -148,7 +148,7 @@ var AudioSource = cc.Class({
return value;
},
animatable: false,
tooltip: 'i18n:COMPONENT.audio.mute',
tooltip: CC_DEV && 'i18n:COMPONENT.audio.mute',
},
/**
@@ -170,7 +170,7 @@ var AudioSource = cc.Class({
return value;
},
animatable: false,
tooltip: 'i18n:COMPONENT.audio.loop'
tooltip: CC_DEV && 'i18n:COMPONENT.audio.loop'
},
/**
@@ -182,7 +182,7 @@ var AudioSource = cc.Class({
*/
playOnLoad: {
default: false,
tooltip: 'i18n:COMPONENT.audio.play_on_load',
tooltip: CC_DEV && 'i18n:COMPONENT.audio.play_on_load',
animatable: false
},
+15 -15
View File
@@ -158,7 +158,7 @@ var Button = cc.Class({
*/
interactable: {
default: true,
tooltip: 'i18n:COMPONENT.button.interactable',
tooltip: CC_DEV && 'i18n:COMPONENT.button.interactable',
notify: function (oldValue) {
if(CC_EDITOR) {
if(oldValue) {
@@ -192,7 +192,7 @@ var Button = cc.Class({
*/
enableAutoGrayEffect: {
default: false,
tooltip: 'i18n:COMPONENT.button.auto_gray_effect',
tooltip: CC_DEV && 'i18n:COMPONENT.button.auto_gray_effect',
notify: function () {
this._updateDisabledState();
}
@@ -206,7 +206,7 @@ var Button = cc.Class({
*/
transition: {
default: Transition.NONE,
tooltip: 'i18n:COMPONENT.button.transition',
tooltip: CC_DEV && 'i18n:COMPONENT.button.transition',
type: Transition,
animatable: false
},
@@ -221,7 +221,7 @@ var Button = cc.Class({
normalColor: {
default: cc.color(214, 214, 214),
displayName: 'Normal',
tooltip: 'i18n:COMPONENT.button.normal_color',
tooltip: CC_DEV && 'i18n:COMPONENT.button.normal_color',
notify: function () {
this._updateState();
}
@@ -235,7 +235,7 @@ var Button = cc.Class({
pressedColor: {
default: cc.color(211, 211, 211),
displayName: 'Pressed',
tooltip: 'i18n:COMPONENT.button.pressed_color',
tooltip: CC_DEV && 'i18n:COMPONENT.button.pressed_color',
},
/**
@@ -246,7 +246,7 @@ var Button = cc.Class({
hoverColor: {
default: cc.Color.WHITE,
displayName: 'Hover',
tooltip: 'i18n:COMPONENT.button.hover_color',
tooltip: CC_DEV && 'i18n:COMPONENT.button.hover_color',
},
/**
@@ -257,7 +257,7 @@ var Button = cc.Class({
disabledColor: {
default: cc.color(124, 124, 124),
displayName: 'Disabled',
tooltip: 'i18n:COMPONENT.button.disabled_color',
tooltip: CC_DEV && 'i18n:COMPONENT.button.disabled_color',
notify: function () {
this._updateState();
}
@@ -271,7 +271,7 @@ var Button = cc.Class({
duration: {
default: 0.1,
range: [0, 10],
tooltip: 'i18n:COMPONENT.button.duration',
tooltip: CC_DEV && 'i18n:COMPONENT.button.duration',
},
/**
@@ -282,7 +282,7 @@ var Button = cc.Class({
*/
zoomScale: {
default: 1.2,
tooltip: 'i18n:COMPONENT.button.zoom_scale'
tooltip: CC_DEV && 'i18n:COMPONENT.button.zoom_scale'
},
// sprite transition
@@ -295,7 +295,7 @@ var Button = cc.Class({
default: null,
type: cc.SpriteFrame,
displayName: 'Normal',
tooltip: 'i18n:COMPONENT.button.normal_sprite',
tooltip: CC_DEV && 'i18n:COMPONENT.button.normal_sprite',
notify: function () {
this._updateState();
}
@@ -310,7 +310,7 @@ var Button = cc.Class({
default: null,
type: cc.SpriteFrame,
displayName: 'Pressed',
tooltip: 'i18n:COMPONENT.button.pressed_sprite',
tooltip: CC_DEV && 'i18n:COMPONENT.button.pressed_sprite',
},
/**
@@ -322,7 +322,7 @@ var Button = cc.Class({
default: null,
type: cc.SpriteFrame,
displayName: 'Hover',
tooltip: 'i18n:COMPONENT.button.hover_sprite',
tooltip: CC_DEV && 'i18n:COMPONENT.button.hover_sprite',
},
/**
@@ -334,7 +334,7 @@ var Button = cc.Class({
default: null,
type: cc.SpriteFrame,
displayName: 'Disabled',
tooltip: 'i18n:COMPONENT.button.disabled_sprite',
tooltip: CC_DEV && 'i18n:COMPONENT.button.disabled_sprite',
notify: function () {
this._updateState();
}
@@ -358,7 +358,7 @@ var Button = cc.Class({
target: {
default: null,
type: cc.Node,
tooltip: "i18n:COMPONENT.button.target",
tooltip: CC_DEV && "i18n:COMPONENT.button.target",
notify: function () {
this._applyTarget();
}
@@ -372,7 +372,7 @@ var Button = cc.Class({
clickEvents: {
default: [],
type: cc.Component.EventHandler,
tooltip: 'i18n:COMPONENT.button.click_events',
tooltip: CC_DEV && 'i18n:COMPONENT.button.click_events',
}
},
+3 -3
View File
@@ -87,7 +87,7 @@ var Canvas = cc.Class({
this._designResolution.height = value.height;
this.applySettings();
},
tooltip: 'i18n:COMPONENT.canvas.design_resolution'
tooltip: CC_DEV && 'i18n:COMPONENT.canvas.design_resolution'
},
_fitWidth: false,
@@ -109,7 +109,7 @@ var Canvas = cc.Class({
this.applySettings();
}
},
tooltip: 'i18n:COMPONENT.canvas.fit_height'
tooltip: CC_DEV && 'i18n:COMPONENT.canvas.fit_height'
},
/**
@@ -128,7 +128,7 @@ var Canvas = cc.Class({
this.applySettings();
}
},
tooltip: 'i18n:COMPONENT.canvas.fit_width'
tooltip: CC_DEV && 'i18n:COMPONENT.canvas.fit_width'
}
},
+1 -1
View File
@@ -352,7 +352,7 @@ var Component = cc.Class({
//},
displayName: 'Script',
type: cc._Script,
tooltip: 'i18n:INSPECTOR.component.script'
tooltip: CC_DEV && 'i18n:INSPECTOR.component.script'
},
/**
+14 -14
View File
@@ -178,7 +178,7 @@ var EditBox = cc.Class({
* @property {String} string
*/
string: {
tooltip: 'i18n:COMPONENT.editbox.string',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.string',
get: function () {
return this._sgNode.string;
},
@@ -193,7 +193,7 @@ var EditBox = cc.Class({
* @property {SpriteFrame} backGroundImage
*/
backgroundImage: {
tooltip: 'i18n:COMPONENT.editbox.backgroundImage',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.backgroundImage',
default: null,
type: cc.SpriteFrame,
notify: function() {
@@ -221,7 +221,7 @@ var EditBox = cc.Class({
*/
returnType: {
default: KeyboardReturnType.DEFAULT,
tooltip: 'i18n:COMPONENT.editbox.returnType',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.returnType',
displayName: 'KeyboardReturnType',
type: KeyboardReturnType,
notify: function() {
@@ -236,7 +236,7 @@ var EditBox = cc.Class({
* @default InputFlag.DEFAULT
*/
inputFlag: {
tooltip: 'i18n:COMPONENT.editbox.input_flag',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.input_flag',
default: InputFlag.DEFAULT,
type: InputFlag,
notify: function() {
@@ -253,7 +253,7 @@ var EditBox = cc.Class({
* @default InputMode.ANY
*/
inputMode: {
tooltip: 'i18n:COMPONENT.editbox.input_mode',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.input_mode',
default: InputMode.ANY,
type: InputMode,
notify: function() {
@@ -267,7 +267,7 @@ var EditBox = cc.Class({
* @property {Number} fontSize
*/
fontSize: {
tooltip: 'i18n:COMPONENT.editbox.font_size',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.font_size',
default: 20,
notify: function() {
this._sgNode.fontSize = this.fontSize;
@@ -280,7 +280,7 @@ var EditBox = cc.Class({
* @property {Number} lineHeight
*/
lineHeight: {
tooltip: 'i18n:COMPONENT.editbox.line_height',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.line_height',
default: 40,
notify: function() {
this._sgNode.setLineHeight(this.lineHeight);
@@ -293,7 +293,7 @@ var EditBox = cc.Class({
* @property {Color} fontColor
*/
fontColor: {
tooltip: 'i18n:COMPONENT.editbox.font_color',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.font_color',
default: cc.Color.WHITE,
notify: function() {
this._sgNode.fontColor = this.fontColor;
@@ -306,7 +306,7 @@ var EditBox = cc.Class({
* @property {String} placeholder
*/
placeholder: {
tooltip: 'i18n:COMPONENT.editbox.placeholder',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.placeholder',
default: 'Enter text here...',
notify: function() {
this._sgNode.placeholder = this.placeholder;
@@ -319,7 +319,7 @@ var EditBox = cc.Class({
* @property {Number} placeholderFontSize
*/
placeholderFontSize: {
tooltip: 'i18n:COMPONENT.editbox.placeholder_font_size',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.placeholder_font_size',
default: 20,
notify: function() {
this._sgNode.placeholderFontSize = this.placeholderFontSize;
@@ -332,7 +332,7 @@ var EditBox = cc.Class({
* @property {Color} placeholderFontColor
*/
placeholderFontColor: {
tooltip: 'i18n:COMPONENT.editbox.placeholder_font_color',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.placeholder_font_color',
default: cc.Color.GRAY,
notify: function() {
this._sgNode.placeholderFontColor = this.placeholderFontColor;
@@ -349,7 +349,7 @@ var EditBox = cc.Class({
* @property {Number} maxLength
*/
maxLength: {
tooltip: 'i18n:COMPONENT.editbox.max_length',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.max_length',
default: 20,
notify: function() {
this._sgNode.maxLength = this.maxLength;
@@ -363,7 +363,7 @@ var EditBox = cc.Class({
* @property {Boolean} stayOnTop
*/
stayOnTop: {
tooltip: 'i18n:COMPONENT.editbox.stay_on_top',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.stay_on_top',
default: false,
notify: function () {
if(!CC_JSB) {
@@ -382,7 +382,7 @@ var EditBox = cc.Class({
* @property {Number} tabIndex
*/
tabIndex: {
tooltip: 'i18n:COMPONENT.editbox.tab_index',
tooltip: CC_DEV && 'i18n:COMPONENT.editbox.tab_index',
get: function () {
return this._tabIndex;
},
+9 -9
View File
@@ -183,7 +183,7 @@ var Label = cc.Class({
string: {
default: 'Label',
multiline: true,
tooltip: 'i18n:COMPONENT.label.string',
tooltip: CC_DEV && 'i18n:COMPONENT.label.string',
notify: function () {
if (this._sgNode) {
if (CC_EDITOR) {
@@ -206,7 +206,7 @@ var Label = cc.Class({
horizontalAlign: {
default: HorizontalAlign.LEFT,
type: HorizontalAlign,
tooltip: 'i18n:COMPONENT.label.horizontal_align',
tooltip: CC_DEV && 'i18n:COMPONENT.label.horizontal_align',
notify: function () {
if (this._sgNode) {
this._sgNode.setHorizontalAlign( this.horizontalAlign );
@@ -223,7 +223,7 @@ var Label = cc.Class({
verticalAlign: {
default: VerticalAlign.TOP,
type: VerticalAlign,
tooltip: 'i18n:COMPONENT.label.vertical_align',
tooltip: CC_DEV && 'i18n:COMPONENT.label.vertical_align',
notify: function () {
if (this._sgNode) {
this._sgNode.setVerticalAlign( this.verticalAlign );
@@ -272,7 +272,7 @@ var Label = cc.Class({
this._updateSgNodeFontSize();
}
},
tooltip: 'i18n:COMPONENT.label.font_size',
tooltip: CC_DEV && 'i18n:COMPONENT.label.font_size',
},
_lineHeight: 40,
@@ -296,7 +296,7 @@ var Label = cc.Class({
this._updateNodeSize();
}
},
tooltip: 'i18n:COMPONENT.label.line_height',
tooltip: CC_DEV && 'i18n:COMPONENT.label.line_height',
},
/**
* !#en Overflow of label.
@@ -306,7 +306,7 @@ var Label = cc.Class({
overflow: {
default: Overflow.NONE,
type: Overflow,
tooltip: 'i18n:COMPONENT.label.overflow',
tooltip: CC_DEV && 'i18n:COMPONENT.label.overflow',
notify: function () {
if (this._sgNode) {
this._sgNode.setOverflow(this.overflow);
@@ -336,7 +336,7 @@ var Label = cc.Class({
}
},
animatable: false,
tooltip: 'i18n:COMPONENT.label.wrap',
tooltip: CC_DEV && 'i18n:COMPONENT.label.wrap',
},
// 这个保存了旧项目的 file 数据
@@ -383,7 +383,7 @@ var Label = cc.Class({
}
},
type: cc.Font,
tooltip: 'i18n:COMPONENT.label.font',
tooltip: CC_DEV && 'i18n:COMPONENT.label.font',
animatable: false
},
@@ -416,7 +416,7 @@ var Label = cc.Class({
},
animatable: false,
tooltip: 'i18n:COMPONENT.label.system_font',
tooltip: CC_DEV && 'i18n:COMPONENT.label.system_font',
},
_bmFontOriginalSize: {
+12 -12
View File
@@ -197,7 +197,7 @@ var Layout = cc.Class({
this._doLayoutDirty();
},
animatable: false,
tooltip: 'i18n:COMPONENT.layout.layout_type'
tooltip: CC_DEV && 'i18n:COMPONENT.layout.layout_type'
},
@@ -211,7 +211,7 @@ var Layout = cc.Class({
*/
resizeMode: {
type: ResizeMode,
tooltip: 'i18n:COMPONENT.layout.resize_mode',
tooltip: CC_DEV && 'i18n:COMPONENT.layout.resize_mode',
get: function() {
return this._resize;
},
@@ -240,7 +240,7 @@ var Layout = cc.Class({
*/
cellSize: {
default: cc.size(40, 40),
tooltip: 'i18n:COMPONENT.layout.cell_size',
tooltip: CC_DEV && 'i18n:COMPONENT.layout.cell_size',
type: cc.Size,
notify: function() {
this._doLayoutDirty();
@@ -257,7 +257,7 @@ var Layout = cc.Class({
*/
startAxis: {
default: AxisDirection.HORIZONTAL,
tooltip: 'i18n:COMPONENT.layout.start_axis',
tooltip: CC_DEV && 'i18n:COMPONENT.layout.start_axis',
type: AxisDirection,
notify: function() {
if (CC_EDITOR && this._resize === ResizeMode.CONTAINER && !cc.engine.isPlaying) {
@@ -281,7 +281,7 @@ var Layout = cc.Class({
*/
paddingLeft: {
default: 0,
tooltip: 'i18n:COMPONENT.layout.padding_left',
tooltip: CC_DEV && 'i18n:COMPONENT.layout.padding_left',
notify: function () {
this._doLayoutDirty();
},
@@ -295,7 +295,7 @@ var Layout = cc.Class({
*/
paddingRight: {
default: 0,
tooltip: 'i18n:COMPONENT.layout.padding_right',
tooltip: CC_DEV && 'i18n:COMPONENT.layout.padding_right',
notify: function () {
this._doLayoutDirty();
},
@@ -309,7 +309,7 @@ var Layout = cc.Class({
*/
paddingTop: {
default: 0,
tooltip: 'i18n:COMPONENT.layout.padding_top',
tooltip: CC_DEV && 'i18n:COMPONENT.layout.padding_top',
notify: function () {
this._doLayoutDirty();
},
@@ -323,7 +323,7 @@ var Layout = cc.Class({
*/
paddingBottom: {
default: 0,
tooltip: 'i18n:COMPONENT.layout.padding_bottom',
tooltip: CC_DEV && 'i18n:COMPONENT.layout.padding_bottom',
notify: function () {
this._doLayoutDirty();
},
@@ -341,7 +341,7 @@ var Layout = cc.Class({
this._doLayoutDirty();
},
animatable: false,
tooltip: 'i18n:COMPONENT.layout.space_x'
tooltip: CC_DEV && 'i18n:COMPONENT.layout.space_x'
},
/**
@@ -355,7 +355,7 @@ var Layout = cc.Class({
this._doLayoutDirty();
},
animatable: false,
tooltip: 'i18n:COMPONENT.layout.space_y'
tooltip: CC_DEV && 'i18n:COMPONENT.layout.space_y'
},
/**
@@ -372,7 +372,7 @@ var Layout = cc.Class({
this._doLayoutDirty();
},
animatable: false,
tooltip: 'i18n:COMPONENT.layout.vertical_direction'
tooltip: CC_DEV && 'i18n:COMPONENT.layout.vertical_direction'
},
/**
@@ -389,7 +389,7 @@ var Layout = cc.Class({
this._doLayoutDirty();
},
animatable: false,
tooltip: 'i18n:COMPONENT.layout.horizontal_direction'
tooltip: CC_DEV && 'i18n:COMPONENT.layout.horizontal_direction'
},
},
+7 -7
View File
@@ -91,7 +91,7 @@ var Mask = cc.Class({
this._refreshStencil();
},
type: MaskType,
tooltip: 'i18n:COMPONENT.mask.type',
tooltip: CC_DEV && 'i18n:COMPONENT.mask.type',
},
/**
@@ -106,7 +106,7 @@ var Mask = cc.Class({
spriteFrame: {
default: null,
type: cc.SpriteFrame,
tooltip: 'i18n:COMPONENT.mask.spriteFrame',
tooltip: CC_DEV && 'i18n:COMPONENT.mask.spriteFrame',
notify: function() {
this._refreshStencil();
}
@@ -131,10 +131,10 @@ var Mask = cc.Class({
type: cc.Float,
range: [0, 1, 0.1],
slide: true,
tooltip: 'i18n:COMPONENT.mask.alphaThreshold',
tooltip: CC_DEV && 'i18n:COMPONENT.mask.alphaThreshold',
notify: function() {
if (cc._renderType === cc.game.RENDER_TYPE_CANVAS) {
cc.warn("The alphaThreshold invalid in Canvas Mode.");
cc.warnID(4201);
return;
}
this._sgNode.setAlphaThreshold(this.alphaThreshold);
@@ -151,10 +151,10 @@ var Mask = cc.Class({
inverted: {
default: false,
type: cc.Boolean,
tooltip: 'i18n:COMPONENT.mask.inverted',
tooltip: CC_DEV && 'i18n:COMPONENT.mask.inverted',
notify: function() {
if (cc._renderType === cc.game.RENDER_TYPE_CANVAS) {
cc.warn("The inverted invalid in Canvas Mode.");
cc.warnID(4202);
return;
}
this._sgNode.setInverted(this.inverted);
@@ -178,7 +178,7 @@ var Mask = cc.Class({
this._refreshStencil();
},
type: cc.Integer,
tooltip: 'i18n:COMPONENT.mask.segements',
tooltip: CC_DEV && 'i18n:COMPONENT.mask.segements',
},
_resizeToTarget: {
+7 -7
View File
@@ -113,7 +113,7 @@ var PageView = cc.Class({
sizeMode: {
default: SizeMode.Unified,
type: SizeMode,
tooltip: 'i18n:COMPONENT.pageview.sizeMode',
tooltip: CC_DEV && 'i18n:COMPONENT.pageview.sizeMode',
notify: function() {
this._syncSizeMode();
}
@@ -127,7 +127,7 @@ var PageView = cc.Class({
direction: {
default: Direction.Horizontal,
type: Direction,
tooltip: 'i18n:COMPONENT.pageview.direction',
tooltip: CC_DEV && 'i18n:COMPONENT.pageview.direction',
notify: function() {
this._syncScrollDirection();
}
@@ -145,7 +145,7 @@ var PageView = cc.Class({
type: cc.Float,
slide: true,
range: [0, 1, 0.01],
tooltip: 'i18n:COMPONENT.pageview.scrollThreshold'
tooltip: CC_DEV && 'i18n:COMPONENT.pageview.scrollThreshold'
},
/**
@@ -162,7 +162,7 @@ var PageView = cc.Class({
autoPageTurningThreshold: {
default: 100,
type: cc.Float,
tooltip: 'i18n:COMPONENT.pageview.autoPageTurningThreshold'
tooltip: CC_DEV && 'i18n:COMPONENT.pageview.autoPageTurningThreshold'
},
/**
@@ -174,7 +174,7 @@ var PageView = cc.Class({
default: 0.1,
type: cc.Float,
range: [0, 1, 0.01],
tooltip: 'i18n:COMPONENT.pageview.pageTurningEventTiming'
tooltip: CC_DEV && 'i18n:COMPONENT.pageview.pageTurningEventTiming'
},
/**
@@ -185,7 +185,7 @@ var PageView = cc.Class({
indicator: {
default: null,
type: cc.PageViewIndicator,
tooltip: 'i18n:COMPONENT.pageview.indicator',
tooltip: CC_DEV && 'i18n:COMPONENT.pageview.indicator',
notify: function() {
if (this.indicator) {
this.indicator.setPageView(this);
@@ -201,7 +201,7 @@ var PageView = cc.Class({
pageEvents: {
default: [],
type: cc.Component.EventHandler,
tooltip: 'i18n:COMPONENT.pageview.pageEvents'
tooltip: CC_DEV && 'i18n:COMPONENT.pageview.pageEvents'
}
},
@@ -73,7 +73,7 @@ var PageViewIndicator = cc.Class({
spriteFrame: {
default: null,
type: cc.SpriteFrame,
tooltip: 'i18n:COMPONENT.pageview_indicator.spriteFrame'
tooltip: CC_DEV && 'i18n:COMPONENT.pageview_indicator.spriteFrame'
},
/**
@@ -84,7 +84,7 @@ var PageViewIndicator = cc.Class({
direction: {
default: Direction.HORIZONTAL,
type: Direction,
tooltip: 'i18n:COMPONENT.pageview_indicator.direction'
tooltip: CC_DEV && 'i18n:COMPONENT.pageview_indicator.direction'
},
/**
@@ -94,7 +94,7 @@ var PageViewIndicator = cc.Class({
*/
cellSize: {
default: cc.size(20, 20),
tooltip: 'i18n:COMPONENT.layout.cell_size'
tooltip: CC_DEV && 'i18n:COMPONENT.layout.cell_size'
},
/**
@@ -104,7 +104,7 @@ var PageViewIndicator = cc.Class({
*/
spacing: {
default: 0,
tooltip: 'i18n:COMPONENT.pageview_indicator.spacing'
tooltip: CC_DEV && 'i18n:COMPONENT.pageview_indicator.spacing'
}
},
+5 -5
View File
@@ -187,7 +187,7 @@ var ProgressBar = cc.Class({
barSprite: {
default: null,
type: cc.Sprite,
tooltip: 'i18n:COMPONENT.progress.bar_sprite',
tooltip: CC_DEV && 'i18n:COMPONENT.progress.bar_sprite',
notify: function() {
this._initBarSprite();
},
@@ -202,7 +202,7 @@ var ProgressBar = cc.Class({
mode: {
default: Mode.HORIZONTAL,
type: Mode,
tooltip: 'i18n:COMPONENT.progress.mode',
tooltip: CC_DEV && 'i18n:COMPONENT.progress.mode',
notify: function() {
if (this.barSprite) {
var entity = this.barSprite.node;
@@ -229,7 +229,7 @@ var ProgressBar = cc.Class({
totalLength: {
default: 1,
range: [0, Number.MAX_VALUE],
tooltip: 'i18n:COMPONENT.progress.total_length',
tooltip: CC_DEV && 'i18n:COMPONENT.progress.total_length',
notify: function(value) {
this._updateBarStatus();
}
@@ -245,7 +245,7 @@ var ProgressBar = cc.Class({
type: 'Float',
range: [0, 1, 0.1],
slide: true,
tooltip: 'i18n:COMPONENT.progress.progress',
tooltip: CC_DEV && 'i18n:COMPONENT.progress.progress',
notify: function() {
this._updateBarStatus();
}
@@ -258,7 +258,7 @@ var ProgressBar = cc.Class({
*/
reverse: {
default: false,
tooltip: 'i18n:COMPONENT.progress.reverse',
tooltip: CC_DEV && 'i18n:COMPONENT.progress.reverse',
notify: function() {
if (this.barSprite) {
this.barSprite.fillStart = 1 - this.barSprite.fillStart;
+7 -7
View File
@@ -86,7 +86,7 @@ var RichText = cc.Class({
string: {
default: '<color=#00ff00>Rich</c><color=#0fffff>Text</color>',
multiline: true,
tooltip: 'i18n:COMPONENT.richtext.string',
tooltip: CC_DEV && 'i18n:COMPONENT.richtext.string',
notify: function () {
this._updateRichTextStatus();
}
@@ -100,7 +100,7 @@ var RichText = cc.Class({
horizontalAlign: {
default: HorizontalAlign.LEFT,
type: HorizontalAlign,
tooltip: 'i18n:COMPONENT.richtext.horizontal_align',
tooltip: CC_DEV && 'i18n:COMPONENT.richtext.horizontal_align',
animatable: false,
notify: function (oldValue) {
if(this.horizontalAlign === oldValue) return;
@@ -117,7 +117,7 @@ var RichText = cc.Class({
*/
fontSize: {
default: 40,
tooltip: 'i18n:COMPONENT.richtext.font_size',
tooltip: CC_DEV && 'i18n:COMPONENT.richtext.font_size',
notify: function (oldValue) {
if(this.fontSize === oldValue) return;
@@ -134,7 +134,7 @@ var RichText = cc.Class({
font: {
default: null,
type: cc.TTFFont,
tooltip: 'i18n:COMPONENT.richtext.font',
tooltip: CC_DEV && 'i18n:COMPONENT.richtext.font',
notify: function (oldValue) {
if(this.font === oldValue) return;
@@ -153,7 +153,7 @@ var RichText = cc.Class({
*/
maxWidth: {
default: 0,
tooltip: 'i18n:COMPONENT.richtext.max_width',
tooltip: CC_DEV && 'i18n:COMPONENT.richtext.max_width',
notify: function (oldValue) {
if(this.maxWidth === oldValue) return;
@@ -169,7 +169,7 @@ var RichText = cc.Class({
*/
lineHeight: {
default: 40,
tooltip: 'i18n:COMPONENT.richtext.line_height',
tooltip: CC_DEV && 'i18n:COMPONENT.richtext.line_height',
notify: function (oldValue) {
if(this.lineHeight === oldValue) return;
@@ -186,7 +186,7 @@ var RichText = cc.Class({
imageAtlas: {
default: null,
type: cc.SpriteAtlas,
tooltip: 'i18n:COMPONENT.richtext.image_atlas',
tooltip: CC_DEV && 'i18n:COMPONENT.richtext.image_atlas',
notify: function(oldValue) {
if(this.imageAtlas === oldValue) return;
+4 -4
View File
@@ -73,7 +73,7 @@ var Scrollbar = cc.Class({
handle: {
default: null,
type: cc.Sprite,
tooltip: 'i18n:COMPONENT.scrollbar.handle',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollbar.handle',
notify: function() {
this._onScroll(cc.p(0, 0));
},
@@ -88,7 +88,7 @@ var Scrollbar = cc.Class({
direction: {
default: Direction.HORIZONTAL,
type: Direction,
tooltip: 'i18n:COMPONENT.scrollbar.direction',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollbar.direction',
notify: function() {
this._onScroll(cc.p(0, 0));
},
@@ -103,7 +103,7 @@ var Scrollbar = cc.Class({
enableAutoHide: {
default: true,
animatable: false,
tooltip: 'i18n:COMPONENT.scrollbar.auto_hide',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollbar.auto_hide',
},
/**
@@ -118,7 +118,7 @@ var Scrollbar = cc.Class({
autoHideTime: {
default: 1.0,
animatable: false,
tooltip: 'i18n:COMPONENT.scrollbar.auto_hide_time',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollbar.auto_hide_time',
}
},
+11 -11
View File
@@ -184,7 +184,7 @@ var ScrollView = cc.Class({
content: {
default: undefined,
type: cc.Node,
tooltip: 'i18n:COMPONENT.scrollview.content',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollview.content',
},
/**
@@ -195,7 +195,7 @@ var ScrollView = cc.Class({
horizontal: {
default: true,
animatable: false,
tooltip: 'i18n:COMPONENT.scrollview.horizontal',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollview.horizontal',
},
/**
@@ -206,7 +206,7 @@ var ScrollView = cc.Class({
vertical: {
default: true,
animatable: false,
tooltip: 'i18n:COMPONENT.scrollview.vertical',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollview.vertical',
},
/**
@@ -217,7 +217,7 @@ var ScrollView = cc.Class({
inertia: {
default: true,
animatable: false,
tooltip: 'i18n:COMPONENT.scrollview.inertia',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollview.inertia',
},
/**
@@ -233,7 +233,7 @@ var ScrollView = cc.Class({
type: 'Float',
range: [0, 1, 0.1],
animatable: false,
tooltip: 'i18n:COMPONENT.scrollview.brake',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollview.brake',
},
/**
@@ -244,7 +244,7 @@ var ScrollView = cc.Class({
elastic: {
default: true,
animatable: false,
tooltip: 'i18n:COMPONENT.scrollview.elastic',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollview.elastic',
},
/**
@@ -256,7 +256,7 @@ var ScrollView = cc.Class({
default: 1,
range: [0, 10],
animatable: false,
tooltip: 'i18n:COMPONENT.scrollview.bounceDuration',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollview.bounceDuration',
},
/**
@@ -267,7 +267,7 @@ var ScrollView = cc.Class({
horizontalScrollBar: {
default: undefined,
type: cc.Scrollbar,
tooltip: 'i18n:COMPONENT.scrollview.horizontal_bar',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollview.horizontal_bar',
notify: function() {
if (this.horizontalScrollBar) {
this.horizontalScrollBar.setTargetScrollView(this);
@@ -285,7 +285,7 @@ var ScrollView = cc.Class({
verticalScrollBar: {
default: undefined,
type: cc.Scrollbar,
tooltip: 'i18n:COMPONENT.scrollview.vertical_bar',
tooltip: CC_DEV && 'i18n:COMPONENT.scrollview.vertical_bar',
notify: function() {
if (this.verticalScrollBar) {
this.verticalScrollBar.setTargetScrollView(this);
@@ -303,7 +303,7 @@ var ScrollView = cc.Class({
scrollEvents: {
default: [],
type: cc.Component.EventHandler,
tooltip: 'i18n:COMPONENT.scrollview.scrollEvents'
tooltip: CC_DEV && 'i18n:COMPONENT.scrollview.scrollEvents'
},
/**
@@ -316,7 +316,7 @@ var ScrollView = cc.Class({
cancelInnerEvents: {
default: true,
animatable: false,
tooltip: 'i18n:COMPONENT.scrollview.cancelInnerEvents'
tooltip: CC_DEV && 'i18n:COMPONENT.scrollview.cancelInnerEvents'
}
},
+4 -4
View File
@@ -71,7 +71,7 @@ var Slider = cc.Class({
handle: {
default: null,
type: cc.Button,
tooltip: 'i18n:COMPONENT.slider.handle',
tooltip: CC_DEV && 'i18n:COMPONENT.slider.handle',
notify: function() {
if (CC_EDITOR && this.handle) {
this._updateHandlePosition();
@@ -87,7 +87,7 @@ var Slider = cc.Class({
direction: {
default: Direction.Horizontal,
type: Direction,
tooltip: 'i18n:COMPONENT.slider.direction'
tooltip: CC_DEV && 'i18n:COMPONENT.slider.direction'
},
/**
@@ -100,7 +100,7 @@ var Slider = cc.Class({
type: cc.Float,
range: [0, 1, 0.1],
slide: true,
tooltip: 'i18n:COMPONENT.slider.progress',
tooltip: CC_DEV && 'i18n:COMPONENT.slider.progress',
notify: function() {
this._updateHandlePosition();
}
@@ -114,7 +114,7 @@ var Slider = cc.Class({
slideEvents: {
default: [],
type: cc.Component.EventHandler,
tooltip: 'i18n:COMPONENT.slider.slideEvents'
tooltip: CC_DEV && 'i18n:COMPONENT.slider.slideEvents'
}
},
+10 -10
View File
@@ -144,7 +144,7 @@ var Sprite = cc.Class({
_atlas: {
default: null,
type: cc.SpriteAtlas,
tooltip: 'i18n:COMPONENT.sprite.atlas',
tooltip: CC_DEV && 'i18n:COMPONENT.sprite.atlas',
editorOnly: true,
visible: true,
animatable: false
@@ -203,7 +203,7 @@ var Sprite = cc.Class({
},
type: SpriteType,
animatable: false,
tooltip: 'i18n:COMPONENT.sprite.type',
tooltip: CC_DEV && 'i18n:COMPONENT.sprite.type',
},
/**
@@ -225,7 +225,7 @@ var Sprite = cc.Class({
this._sgNode && this._sgNode.setFillType(value);
},
type: FillType,
tooltip: 'i18n:COMPONENT.sprite.fill_type'
tooltip: CC_DEV && 'i18n:COMPONENT.sprite.fill_type'
},
/**
@@ -246,7 +246,7 @@ var Sprite = cc.Class({
this._fillCenter = cc.v2(value);
this._sgNode && this._sgNode.setFillCenter(this._fillCenter);
},
tooltip: 'i18n:COMPONENT.sprite.fill_center',
tooltip: CC_DEV && 'i18n:COMPONENT.sprite.fill_center',
},
/**
@@ -268,7 +268,7 @@ var Sprite = cc.Class({
this._fillStart = cc.clampf(value, -1, 1);
this._sgNode && this._sgNode.setFillStart(value);
},
tooltip: 'i18n:COMPONENT.sprite.fill_start'
tooltip: CC_DEV && 'i18n:COMPONENT.sprite.fill_start'
},
/**
@@ -290,7 +290,7 @@ var Sprite = cc.Class({
this._fillRange = cc.clampf(value, -1, 1);
this._sgNode && this._sgNode.setFillRange(value);
},
tooltip: 'i18n:COMPONENT.sprite.fill_range'
tooltip: CC_DEV && 'i18n:COMPONENT.sprite.fill_range'
},
/**
* !#en specify the frame is trimmed or not.
@@ -311,7 +311,7 @@ var Sprite = cc.Class({
}
},
animatable: false,
tooltip: 'i18n:COMPONENT.sprite.trim'
tooltip: CC_DEV && 'i18n:COMPONENT.sprite.trim'
},
/**
@@ -333,7 +333,7 @@ var Sprite = cc.Class({
},
animatable: false,
type:BlendFactor,
tooltip: 'i18n:COMPONENT.sprite.src_blend_factor'
tooltip: CC_DEV && 'i18n:COMPONENT.sprite.src_blend_factor'
},
/**
@@ -355,7 +355,7 @@ var Sprite = cc.Class({
},
animatable: false,
type: BlendFactor,
tooltip: 'i18n:COMPONENT.sprite.dst_blend_factor'
tooltip: CC_DEV && 'i18n:COMPONENT.sprite.dst_blend_factor'
},
/**
@@ -378,7 +378,7 @@ var Sprite = cc.Class({
},
animatable: false,
type: SizeMode,
tooltip: 'i18n:COMPONENT.sprite.size_mode'
tooltip: CC_DEV && 'i18n:COMPONENT.sprite.size_mode'
}
},
+3 -3
View File
@@ -48,7 +48,7 @@ var Toggle = cc.Class({
*/
isChecked: {
default: true,
tooltip: 'i18n:COMPONENT.toggle.isChecked',
tooltip: CC_DEV && 'i18n:COMPONENT.toggle.isChecked',
notify: function() {
this._updateCheckMark();
}
@@ -63,7 +63,7 @@ var Toggle = cc.Class({
*/
toggleGroup: {
default: null,
tooltip: 'i18n:COMPONENT.toggle.toggleGroup',
tooltip: CC_DEV && 'i18n:COMPONENT.toggle.toggleGroup',
type: cc.ToggleGroup
},
@@ -75,7 +75,7 @@ var Toggle = cc.Class({
checkMark: {
default: null,
type: cc.Sprite,
tooltip: 'i18n:COMPONENT.toggle.checkMark'
tooltip: CC_DEV && 'i18n:COMPONENT.toggle.checkMark'
},
/**
+1 -1
View File
@@ -51,7 +51,7 @@ var ToggleGroup = cc.Class({
* @property {Boolean} allowSwitchOff
*/
allowSwitchOff: {
tooltip: 'i18n:COMPONENT.toggle_group.allowSwitchOff',
tooltip: CC_DEV && 'i18n:COMPONENT.toggle_group.allowSwitchOff',
default: false
}
},
+6 -6
View File
@@ -95,7 +95,7 @@ var VideoPlayer = cc.Class({
* @property {VideoPlayer.ResourceType} resourceType
*/
resourceType: {
tooltip: 'i18n:COMPONENT.videoplayer.resourceType',
tooltip: CC_DEV && 'i18n:COMPONENT.videoplayer.resourceType',
type: ResourceType,
set: function ( value ) {
this._resourceType = value;
@@ -113,7 +113,7 @@ var VideoPlayer = cc.Class({
* @property {String} remoteURL
*/
remoteURL: {
tooltip: 'i18n:COMPONENT.videoplayer.url',
tooltip: CC_DEV && 'i18n:COMPONENT.videoplayer.url',
type: cc.String,
set: function ( url ) {
this._remoteURL = url;
@@ -134,7 +134,7 @@ var VideoPlayer = cc.Class({
* @property {String} clip
*/
clip: {
tooltip: 'i18n:COMPONENT.videoplayer.video',
tooltip: CC_DEV && 'i18n:COMPONENT.videoplayer.video',
get: function () {
return this._clip;
},
@@ -153,7 +153,7 @@ var VideoPlayer = cc.Class({
* @property {Number} currentTime
*/
currentTime: {
tooltip: 'i18n:COMPONENT.videoplayer.currentTime',
tooltip: CC_DEV && 'i18n:COMPONENT.videoplayer.currentTime',
type: cc.Float,
set: function ( time ) {
if(this._sgNode) {
@@ -174,7 +174,7 @@ var VideoPlayer = cc.Class({
* @property {Boolean} keepAspectRatio
*/
keepAspectRatio: {
tooltip: 'i18n:COMPONENT.videoplayer.keepAspectRatio',
tooltip: CC_DEV && 'i18n:COMPONENT.videoplayer.keepAspectRatio',
default: true,
type: cc.Boolean,
notify: function () {
@@ -188,7 +188,7 @@ var VideoPlayer = cc.Class({
* @property {Boolean} isFullscreen
*/
isFullscreen: {
tooltip: 'i18n:COMPONENT.videoplayer.isFullscreen',
tooltip: CC_DEV && 'i18n:COMPONENT.videoplayer.isFullscreen',
default: false,
type: cc.Boolean,
notify: function() {
+1 -1
View File
@@ -72,7 +72,7 @@ var WebView = cc.Class({
*/
url: {
type: String,
tooltip: 'i18n:COMPONENT.webview.url',
tooltip: CC_DEV && 'i18n:COMPONENT.webview.url',
get: function () {
return this._url;
},
+14 -14
View File
@@ -78,7 +78,7 @@ var Widget = cc.Class({
}
},
type: cc.Node,
tooltip: 'i18n:COMPONENT.widget.target',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.target',
},
// ENABLE ALIGN ?
@@ -98,7 +98,7 @@ var Widget = cc.Class({
this._setAlign(TOP, value);
},
animatable: false,
tooltip: 'i18n:COMPONENT.widget.align_top',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.align_top',
},
/**
@@ -125,7 +125,7 @@ var Widget = cc.Class({
}
},
animatable: false,
tooltip: 'i18n:COMPONENT.widget.align_v_center',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.align_v_center',
},
/**
@@ -143,7 +143,7 @@ var Widget = cc.Class({
this._setAlign(BOT, value);
},
animatable: false,
tooltip: 'i18n:COMPONENT.widget.align_bottom',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.align_bottom',
},
/**
@@ -161,7 +161,7 @@ var Widget = cc.Class({
this._setAlign(LEFT, value);
},
animatable: false,
tooltip: 'i18n:COMPONENT.widget.align_left',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.align_left',
},
/**
@@ -188,7 +188,7 @@ var Widget = cc.Class({
}
},
animatable: false,
tooltip: 'i18n:COMPONENT.widget.align_h_center',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.align_h_center',
},
/**
@@ -206,7 +206,7 @@ var Widget = cc.Class({
this._setAlign(RIGHT, value);
},
animatable: false,
tooltip: 'i18n:COMPONENT.widget.align_right',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.align_right',
},
/**
@@ -263,7 +263,7 @@ var Widget = cc.Class({
set: function (value) {
this._top = value;
},
tooltip: 'i18n:COMPONENT.widget.top',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.top',
},
/**
@@ -283,7 +283,7 @@ var Widget = cc.Class({
set: function (value) {
this._bottom = value;
},
tooltip: 'i18n:COMPONENT.widget.bottom',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.bottom',
},
/**
@@ -303,7 +303,7 @@ var Widget = cc.Class({
set: function (value) {
this._left = value;
},
tooltip: 'i18n:COMPONENT.widget.left',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.left',
},
/**
@@ -323,7 +323,7 @@ var Widget = cc.Class({
set: function (value) {
this._right = value;
},
tooltip: 'i18n:COMPONENT.widget.right',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.right',
},
/**
@@ -342,7 +342,7 @@ var Widget = cc.Class({
set: function (value) {
this._horizontalCenter = value;
},
tooltip: 'i18n:COMPONENT.widget.horizontal_center',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.horizontal_center',
},
/**
@@ -361,7 +361,7 @@ var Widget = cc.Class({
set: function (value) {
this._verticalCenter = value;
},
tooltip: 'i18n:COMPONENT.widget.vertical_center',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.vertical_center',
},
// PARCENTAGE OR ABSOLUTE
@@ -488,7 +488,7 @@ var Widget = cc.Class({
*/
isAlignOnce: {
default: true,
tooltip: 'i18n:COMPONENT.widget.align_once',
tooltip: CC_DEV && 'i18n:COMPONENT.widget.align_once',
displayName: "AlignOnce"
},
+2 -2
View File
@@ -29,7 +29,7 @@ var vert = [
'void main()',
'{',
// ' gl_Position = CC_MVPMatrix * a_position;',
' gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position;',
' gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position;',
'}'
];
@@ -41,7 +41,7 @@ var frag = [
'uniform vec4 color;',
'',
'void main(void) {',
' gl_FragColor = color;',
' gl_FragColor = color;',
'}'
];
@@ -212,13 +212,13 @@ Scale9Sprite.WebGLRenderCmd._getGrayShaderProgram = function(){
Scale9Sprite.WebGLRenderCmd._grayShaderFragment =
"precision lowp float;\n"
+ "varying vec4 v_fragmentColor; \n"
+ "varying vec2 v_texCoord; \n"
+ "void main() \n"
+ "{ \n"
+ " vec4 c = texture2D(CC_Texture0, v_texCoord); \n"
+ " gl_FragColor.xyz = vec3(0.2126*c.r + 0.7152*c.g + 0.0722*c.b); \n"
+" gl_FragColor.w = c.w ; \n"
+ "varying vec4 v_fragmentColor;\n"
+ "varying vec2 v_texCoord;\n"
+ "void main()\n"
+ "{\n"
+ " vec4 c = texture2D(CC_Texture0, v_texCoord);\n"
+ " gl_FragColor.xyz = vec3(0.2126*c.r + 0.7152*c.g + 0.0722*c.b);\n"
+" gl_FragColor.w = c.w ;\n"
+ "}";
Scale9Sprite.WebGLRenderCmd._distortionProgram = null;
@@ -244,13 +244,13 @@ Scale9Sprite.WebGLRenderCmd._getDistortionProgram = function(){
var distortionSpriteShader = {
shaderKey: 'cc.Sprite.Shader.Distortion',
fShader: "precision lowp float;\n"
+ "varying vec4 v_fragmentColor; \n"
+ "varying vec2 v_texCoord; \n"
+ "uniform vec2 u_offset; \n"
+ "uniform vec2 u_offset_tiling; \n"
+ "varying vec4 v_fragmentColor;\n"
+ "varying vec2 v_texCoord;\n"
+ "uniform vec2 u_offset;\n"
+ "uniform vec2 u_offset_tiling;\n"
+ "const float PI = 3.14159265359;\n"
+ "void main() \n"
+ "{ \n"
+ "void main()\n"
+ "{\n"
+ "float halfPI = 0.5 * PI;\n"
+ "float maxFactor = sin(halfPI);\n"
+ "vec2 uv = v_texCoord;\n"
@@ -259,7 +259,7 @@ var distortionSpriteShader = {
+ "if (d < (2.0-maxFactor)) {\n"
+ "d = length(xy * maxFactor);\n"
+ "float z = sqrt(1.0 - d * d);\n"
+ " float r = atan(d, z) / PI;\n"
+ "float r = atan(d, z) / PI;\n"
+ "float phi = atan(xy.y, xy.x);\n"
+ "uv.x = r * cos(phi) + 0.5;\n"
+ "uv.y = r * sin(phi) + 0.5;\n"
@@ -267,7 +267,7 @@ var distortionSpriteShader = {
+ "discard;\n"
+ "}\n"
+ "uv = uv * u_offset_tiling + u_offset;\n"
+ "uv = fract(uv); \n"
+ "uv = fract(uv);\n"
+ "gl_FragColor = v_fragmentColor * texture2D(CC_Texture0, uv);\n"
+ "}"
};
+9 -9
View File
@@ -85,15 +85,15 @@ cc.GLProgram = cc._Class.extend(/** @lends cc.GLProgram# */{
var preStr = cc.GLProgram._isHighpSupported() ? "precision highp float;\n" : "precision mediump float;\n";
source = preStr
+ "uniform mat4 CC_PMatrix; \n"
+ "uniform mat4 CC_MVMatrix; \n"
+ "uniform mat4 CC_MVPMatrix; \n"
+ "uniform vec4 CC_Time; \n"
+ "uniform vec4 CC_SinTime; \n"
+ "uniform vec4 CC_CosTime; \n"
+ "uniform vec4 CC_Random01; \n"
+ "uniform sampler2D CC_Texture0; \n"
+ "//CC INCLUDES END \n" + source;
+ "uniform mat4 CC_PMatrix;\n"
+ "uniform mat4 CC_MVMatrix;\n"
+ "uniform mat4 CC_MVPMatrix;\n"
+ "uniform vec4 CC_Time;\n"
+ "uniform vec4 CC_SinTime;\n"
+ "uniform vec4 CC_CosTime;\n"
+ "uniform vec4 CC_Random01;\n"
+ "uniform sampler2D CC_Texture0;\n"
+ "//CC INCLUDES END\n" + source;
this._glContext.shaderSource(shader, source);
this._glContext.compileShader(shader);
+132 -134
View File
@@ -41,26 +41,25 @@ cc.PresetShaders = {
*/
POSITION_UCOLOR_FRAG : "precision lowp float;\n"
+ "varying vec4 v_fragmentColor;\n"
+ "void main() \n"
+ "{ \n"
+ " gl_FragColor = v_fragmentColor; \n"
+ "}\n",
+ "void main()\n"
+ "{\n"
+ " gl_FragColor = v_fragmentColor;\n"
+ "}",
/**
* @property POSITION_UCOLOR_VERT
* @type {String}
*/
POSITION_UCOLOR_VERT :
"attribute vec4 a_position;\n"
+ "uniform vec4 u_color;\n"
POSITION_UCOLOR_VERT : "attribute vec4 a_position;\n"
+ "uniform vec4 u_color;\n"
+ "uniform float u_pointSize;\n"
+ "varying lowp vec4 v_fragmentColor; \n"
+ "void main(void) \n"
+ "varying lowp vec4 v_fragmentColor;\n"
+ "void main(void)\n"
+ "{\n"
//+ " gl_Position = CC_MVPMatrix * a_position; \n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position; \n"
+ " gl_PointSize = u_pointSize; \n"
+ " v_fragmentColor = u_color; \n"
//+ " gl_Position = CC_MVPMatrix * a_position;\n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position;\n"
+ " gl_PointSize = u_pointSize;\n"
+ " v_fragmentColor = u_color;\n"
+ "}",
//---------------------Shader_PositionColor Shader Source-----------------------
@@ -68,12 +67,12 @@ cc.PresetShaders = {
* @property POSITION_COLOR_FRAG
* @type {String}
*/
POSITION_COLOR_FRAG : "precision lowp float; \n"
+ "varying vec4 v_fragmentColor; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_FragColor = v_fragmentColor; \n"
+ "} ",
POSITION_COLOR_FRAG : "precision lowp float;\n"
+ "varying vec4 v_fragmentColor;\n"
+ "void main()\n"
+ "{\n"
+ " gl_FragColor = v_fragmentColor;\n"
+ "}",
/**
* @property POSITION_COLOR_VERT
@@ -84,8 +83,8 @@ cc.PresetShaders = {
+ "varying lowp vec4 v_fragmentColor;\n"
+ "void main()\n"
+ "{\n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position; \n"
+ " v_fragmentColor = a_color; \n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position;\n"
+ " v_fragmentColor = a_color;\n"
+ "}",
/**
@@ -97,8 +96,8 @@ cc.PresetShaders = {
+ "varying lowp vec4 v_fragmentColor;\n"
+ "void main()\n"
+ "{\n"
+ " gl_Position = CC_PMatrix * a_position; \n"
+ " v_fragmentColor = a_color; \n"
+ " gl_Position = CC_PMatrix * a_position;\n"
+ " v_fragmentColor = a_color;\n"
+ "}",
// --------------------- Shader_PositionColorLengthTexture Shader source------------------------
@@ -106,33 +105,33 @@ cc.PresetShaders = {
* @property POSITION_COLOR_LENGTH_TEXTURE_FRAG
* @type {String}
*/
POSITION_COLOR_LENGTH_TEXTURE_FRAG : "// #extension GL_OES_standard_derivatives : enable\n"
+ "varying mediump vec4 v_color;\n"
POSITION_COLOR_LENGTH_TEXTURE_FRAG : // + #extension GL_OES_standard_derivatives : enable\n"
"varying mediump vec4 v_color;\n"
+ "varying mediump vec2 v_texcoord;\n"
+ "void main() \n"
+ "{ \n"
+ "// #if defined GL_OES_standard_derivatives \n"
+ "// gl_FragColor = v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord)); \n"
+ "// #else \n"
+ "gl_FragColor = v_color * step(0.0, 1.0 - length(v_texcoord)); \n"
+ "// #endif \n"
+ "void main()\n"
+ "{\n"
// + #if defined GL_OES_standard_derivatives\n"
// + gl_FragColor=v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0-length(v_texcoord));\n"
// + #else\n"
+ " gl_FragColor = v_color * step(0.0, 1.0 - length(v_texcoord));\n"
// + #endif\n"
+ "}",
/**
* @property POSITION_COLOR_LENGTH_TEXTURE_VERT
* @type {String}
*/
POSITION_COLOR_LENGTH_TEXTURE_VERT : "attribute mediump vec4 a_position; \n"
+ "attribute mediump vec2 a_texcoord; \n"
+ "attribute mediump vec4 a_color; \n"
+ "varying mediump vec4 v_color; \n"
+ "varying mediump vec2 v_texcoord; \n"
+ "void main() \n"
+ "{ \n"
+ " v_color = a_color;//vec4(a_color.rgb * a_color.a, a_color.a); \n"
+ " v_texcoord = a_texcoord; \n"
//+ " gl_Position = CC_MVPMatrix * a_position; \n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position; \n"
POSITION_COLOR_LENGTH_TEXTURE_VERT : "attribute mediump vec4 a_position;\n"
+ "attribute mediump vec2 a_texcoord;\n"
+ "attribute mediump vec4 a_color;\n"
+ "varying mediump vec4 v_color;\n"
+ "varying mediump vec2 v_texcoord;\n"
+ "void main()\n"
+ "{\n"
+ " v_color = a_color;\n" //vec4(a_color.rgb*a_color.a, a_color.a);
+ " v_texcoord = a_texcoord;\n"
//+ " gl_Position = CC_MVPMatrix * a_position;\n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position;\n"
+ "}",
// ----------------------Shader_PositionTexture Shader Source-------------------------------------
@@ -140,25 +139,25 @@ cc.PresetShaders = {
* @property POSITION_TEXTURE_FRAG
* @type {String}
*/
POSITION_TEXTURE_FRAG : "precision lowp float; \n"
+ "varying vec2 v_texCoord; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_FragColor = texture2D(CC_Texture0, v_texCoord); \n"
POSITION_TEXTURE_FRAG : "precision lowp float;\n"
+ "varying vec2 v_texCoord;\n"
+ "void main()\n"
+ "{\n"
+ " gl_FragColor = texture2D(CC_Texture0, v_texCoord);\n"
+ "}",
/**
* @property POSITION_TEXTURE_VERT
* @type {String}
*/
POSITION_TEXTURE_VERT : "attribute vec4 a_position; \n"
+ "attribute vec2 a_texCoord; \n"
+ "varying mediump vec2 v_texCoord; \n"
+ "void main() \n"
+ "{ \n"
//+ " gl_Position = CC_MVPMatrix * a_position; \n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position; \n"
+ " v_texCoord = a_texCoord; \n"
POSITION_TEXTURE_VERT : "attribute vec4 a_position;\n"
+ "attribute vec2 a_texCoord;\n"
+ "varying mediump vec2 v_texCoord;\n"
+ "void main()\n"
+ "{\n"
// + " gl_Position = CC_MVPMatrix * a_position;\n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position;\n"
+ " v_texCoord = a_texCoord;\n"
+ "}",
// ------------------------Shader_PositionTexture_uColor Shader Source-------------------------------
@@ -166,12 +165,12 @@ cc.PresetShaders = {
* @property POSITION_TEXTURE_UCOLOR_FRAG
* @type {String}
*/
POSITION_TEXTURE_UCOLOR_FRAG : "precision lowp float; \n"
+ "uniform vec4 u_color; \n"
+ "varying vec2 v_texCoord; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_FragColor = texture2D(CC_Texture0, v_texCoord) * u_color; \n"
POSITION_TEXTURE_UCOLOR_FRAG : "precision lowp float;\n"
+ "uniform vec4 u_color;\n"
+ "varying vec2 v_texCoord;\n"
+ "void main()\n"
+ "{\n"
+ " gl_FragColor=texture2D(CC_Texture0, v_texCoord) * u_color;\n"
+ "}",
/**
@@ -179,13 +178,13 @@ cc.PresetShaders = {
* @type {String}
*/
POSITION_TEXTURE_UCOLOR_VERT : "attribute vec4 a_position;\n"
+ "attribute vec2 a_texCoord; \n"
+ "varying mediump vec2 v_texCoord; \n"
+ "void main() \n"
+ "{ \n"
//+ " gl_Position = CC_MVPMatrix * a_position; \n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position; \n"
+ " v_texCoord = a_texCoord; \n"
+ "attribute vec2 a_texCoord;\n"
+ "varying mediump vec2 v_texCoord;\n"
+ "void main()\n"
+ "{\n"
//+ " gl_Position = CC_MVPMatrix * a_position;\n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position;\n"
+ " v_texCoord = a_texCoord;\n"
+ "}",
//---------------------Shader_PositionTextureA8Color Shader source-------------------------------
@@ -193,30 +192,29 @@ cc.PresetShaders = {
* @property POSITION_TEXTURE_A8COLOR_FRAG
* @type {String}
*/
POSITION_TEXTURE_A8COLOR_FRAG : "precision lowp float; \n"
+ "varying vec4 v_fragmentColor; \n"
+ "varying vec2 v_texCoord; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_FragColor = vec4( v_fragmentColor.rgb, \n" // RGB from uniform
+ " v_fragmentColor.a * texture2D(CC_Texture0, v_texCoord).a \n" // A from texture and uniform
+ " ); \n"
POSITION_TEXTURE_A8COLOR_FRAG : "precision lowp float;\n"
+ "varying vec4 v_fragmentColor;\n"
+ "varying vec2 v_texCoord;\n"
+ "void main()\n"
+ "{\n"
+ " gl_FragColor = vec4(v_fragmentColor.rgb,\n"// RGB from uniform
+ " v_fragmentColor.a * texture2D(CC_Texture0, v_texCoord).a);\n"// A from texture and uniform
+ "}",
/**
* @property POSITION_TEXTURE_A8COLOR_VERT
* @type {String}
*/
POSITION_TEXTURE_A8COLOR_VERT : "attribute vec4 a_position; \n"
+ "attribute vec2 a_texCoord; \n"
+ "attribute vec4 a_color; \n"
+ "varying lowp vec4 v_fragmentColor; \n"
+ "varying mediump vec2 v_texCoord; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position; \n"
+ " v_fragmentColor = a_color; \n"
+ " v_texCoord = a_texCoord; \n"
POSITION_TEXTURE_A8COLOR_VERT : "attribute vec4 a_position;\n"
+ "attribute vec2 a_texCoord;\n"
+ "attribute vec4 a_color;\n"
+ "varying lowp vec4 v_fragmentColor;\n"
+ "varying mediump vec2 v_texCoord;\n"
+ "void main()\n"
+ "{\n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position;\n"
+ " v_fragmentColor = a_color;\n"
+ " v_texCoord = a_texCoord;\n"
+ "}",
// ------------------------Shader_PositionTextureColor Shader source------------------------------------
@@ -225,43 +223,43 @@ cc.PresetShaders = {
* @type {String}
*/
POSITION_TEXTURE_COLOR_FRAG : "precision lowp float;\n"
+ "varying vec4 v_fragmentColor; \n"
+ "varying vec2 v_texCoord; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_FragColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord); \n"
+ "varying vec4 v_fragmentColor;\n"
+ "varying vec2 v_texCoord;\n"
+ "void main()\n"
+ "{\n"
+ " gl_FragColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord);\n"
+ "}",
/**
* @property POSITION_TEXTURE_COLOR_VERT
* @type {String}
*/
POSITION_TEXTURE_COLOR_VERT : "attribute vec4 a_position; \n"
+ "attribute vec2 a_texCoord; \n"
+ "attribute vec4 a_color; \n"
+ "varying lowp vec4 v_fragmentColor; \n"
+ "varying mediump vec2 v_texCoord; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position; \n"
+ " v_fragmentColor = a_color; \n"
+ " v_texCoord = a_texCoord; \n"
POSITION_TEXTURE_COLOR_VERT : "attribute vec4 a_position;\n"
+ "attribute vec2 a_texCoord;\n"
+ "attribute vec4 a_color;\n"
+ "varying lowp vec4 v_fragmentColor;\n"
+ "varying mediump vec2 v_texCoord;\n"
+ "void main()\n"
+ "{\n"
+ " gl_Position = (CC_PMatrix * CC_MVMatrix) * a_position;\n"
+ " v_fragmentColor = a_color;\n"
+ " v_texCoord = a_texCoord;\n"
+ "}",
/**
* @property SPRITE_POSITION_TEXTURE_COLOR_VERT
* @type {String}
*/
SPRITE_POSITION_TEXTURE_COLOR_VERT : "attribute vec4 a_position; \n"
+ "attribute vec2 a_texCoord; \n"
+ "attribute vec4 a_color; \n"
+ "varying lowp vec4 v_fragmentColor; \n"
+ "varying mediump vec2 v_texCoord; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_Position = CC_PMatrix * a_position; \n"
+ " v_fragmentColor = a_color; \n"
+ " v_texCoord = a_texCoord; \n"
SPRITE_POSITION_TEXTURE_COLOR_VERT : "attribute vec4 a_position;\n"
+ "attribute vec2 a_texCoord;\n"
+ "attribute vec4 a_color;\n"
+ "varying lowp vec4 v_fragmentColor;\n"
+ "varying mediump vec2 v_texCoord;\n"
+ "void main()\n"
+ "{\n"
+ " gl_Position = CC_PMatrix * a_position;\n"
+ " v_fragmentColor = a_color;\n"
+ " v_texCoord = a_texCoord;\n"
+ "}",
//-----------------------Shader_PositionTextureColorAlphaTest_frag Shader Source----------------------------
@@ -269,18 +267,18 @@ cc.PresetShaders = {
* @property POSITION_TEXTURE_COLOR_ALPHATEST_FRAG
* @type {String}
*/
POSITION_TEXTURE_COLOR_ALPHATEST_FRAG : "precision lowp float; \n"
+ "varying vec4 v_fragmentColor; \n"
+ "varying vec2 v_texCoord; \n"
+ "uniform float CC_alpha_value; \n"
+ "void main() \n"
+ "{ \n"
+ " vec4 texColor = texture2D(CC_Texture0, v_texCoord); \n"
POSITION_TEXTURE_COLOR_ALPHATEST_FRAG : "precision lowp float;\n"
+ "varying vec4 v_fragmentColor;\n"
+ "varying vec2 v_texCoord;\n"
+ "uniform float CC_alpha_value;\n"
+ "void main()\n"
+ "{\n"
+ " vec4 texColor=texture2D(CC_Texture0, v_texCoord);\n"
// mimic: glAlphaFunc(GL_GREATER)
//pass if ( incoming_pixel >= CC_alpha_value ) => fail if incoming_pixel < CC_alpha_value
+ " if ( texColor.a <= CC_alpha_value ) \n"
+ " discard; \n"
+ " gl_FragColor = texColor * v_fragmentColor; \n"
// pass if(incoming_pixel>=CC_alpha_value)=>fail if incoming_pixel<CC_alpha_value
+ " if(texColor.a <= CC_alpha_value)\n"
+ " discard; \n"
+ " gl_FragColor=texColor*v_fragmentColor;\n"
+ "}",
//-----------------------ShaderEx_SwitchMask_frag Shader Source----------------------------
@@ -288,17 +286,17 @@ cc.PresetShaders = {
* @property EX_SWITCHMASK_FRAG
* @type {String}
*/
EX_SWITCHMASK_FRAG : "precision lowp float; \n"
+ "varying vec4 v_fragmentColor; \n"
+ "varying vec2 v_texCoord; \n"
+ "uniform sampler2D u_texture; \n"
+ "uniform sampler2D u_mask; \n"
+ "void main() \n"
+ "{ \n"
+ " vec4 texColor = texture2D(u_texture, v_texCoord); \n"
+ " vec4 maskColor = texture2D(u_mask, v_texCoord); \n"
+ " vec4 finalColor = vec4(texColor.r, texColor.g, texColor.b, maskColor.a * texColor.a); \n"
+ " gl_FragColor = v_fragmentColor * finalColor; \n"
EX_SWITCHMASK_FRAG : "precision lowp float;\n"
+ "varying vec4 v_fragmentColor;\n"
+ "varying vec2 v_texCoord;\n"
+ "uniform sampler2D u_texture;\n"
+ "uniform sampler2D u_mask;\n"
+ "void main()\n"
+ "{\n"
+ " vec4 texColorc=texture2D(u_texture, v_texCoord);\n"
+ " vec4 maskColor=texture2D(u_mask, v_texCoord);\n"
+ " vec4 finalColor=vec4(texColor.r, texColor.g, texColor.b, maskColor.a*texColor.a);\n"
+ " gl_FragColor=v_fragmentColor*finalColor;\n"
+ "}"
};