mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 01:12:42 +08:00
@@ -347,9 +347,13 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
|
||||
* Returns the size of the OpenGL view in pixels.<br/>
|
||||
* It takes into account any possible rotation (device orientation) of the window.<br/>
|
||||
* On Mac winSize and winSizeInPixels return the same value.
|
||||
* !#zh 获取视图大小,以像素为单位。
|
||||
* (The pixel here refers to the resource resolution. If you want to get the physics resolution of device, you need to use cc.view.getFrameSize())
|
||||
* !#zh
|
||||
* 获取视图大小,以像素为单位(这里的像素指的是资源分辨率。
|
||||
* 如果要获取屏幕物理分辨率,需要用 cc.view.getFrameSize())
|
||||
* @method getWinSizeInPixels
|
||||
* @return {Size}
|
||||
* @deprecated
|
||||
*/
|
||||
getWinSizeInPixels: function () {
|
||||
return cc.size(this._winSizeInPoints.width * this._contentScaleFactor, this._winSizeInPoints.height * this._contentScaleFactor);
|
||||
|
||||
@@ -1975,8 +1975,10 @@ var Node = cc.Class({
|
||||
* Returns the displayed color of Node,
|
||||
* the difference between displayed color and color is that displayed color is calculated based on color and parent node's color when cascade color enabled.
|
||||
* !#zh
|
||||
* 获取节点的显示透明度,
|
||||
* 显示透明度和透明度之间的不同之处在于显示透明度是基于透明度和父节点透明度启用级连透明度时计算的。
|
||||
* 获取节点的显示颜色,
|
||||
* 显示颜色和颜色之间的不同之处在于当启用级连颜色时,
|
||||
* 显示颜色是基于自身颜色和父节点颜色计算的。
|
||||
*
|
||||
* @method getDisplayedColor
|
||||
* @returns {Color}
|
||||
* @example
|
||||
|
||||
@@ -311,6 +311,10 @@ var Button = cc.Class({
|
||||
type: cc.SpriteFrame,
|
||||
displayName: 'Pressed',
|
||||
tooltip: CC_DEV && 'i18n:COMPONENT.button.pressed_sprite',
|
||||
formerlySerializedAs: 'pressedSprite',
|
||||
notify: function () {
|
||||
this._updateState();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -323,6 +327,10 @@ var Button = cc.Class({
|
||||
type: cc.SpriteFrame,
|
||||
displayName: 'Hover',
|
||||
tooltip: CC_DEV && 'i18n:COMPONENT.button.hover_sprite',
|
||||
formerlySerializedAs: 'hoverSprite',
|
||||
notify: function () {
|
||||
this._updateState();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1182,6 +1182,7 @@ cc.ContentStrategy = cc._Class.extend(/** @lends cc.ContentStrategy# */{
|
||||
else {
|
||||
containerStyle.margin = '0px';
|
||||
}
|
||||
containerStyle.padding = "0px";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ var SerializableAttrs = {
|
||||
serializable: {},
|
||||
editorOnly: {},
|
||||
rawType: {},
|
||||
formerlySerializedAs: {}
|
||||
};
|
||||
|
||||
var TYPO_TO_CORRECT_DEV = CC_DEV && {
|
||||
|
||||
@@ -398,9 +398,10 @@ dragonBones.ArmatureDisplay = cc.Class({
|
||||
var self = this;
|
||||
|
||||
// discard exists sgNode
|
||||
var listenersBefore = null;
|
||||
var listenersBefore = null, listenersCacheBefore = null;
|
||||
if (self._sgNode) {
|
||||
listenersBefore = self._sgNode._bubblingListeners; // get the listeners added before
|
||||
listenersCacheBefore = self._sgNode._hasListenerCache;
|
||||
if (self.node._sizeProvider === self._sgNode) {
|
||||
self.node._sizeProvider = null;
|
||||
}
|
||||
@@ -420,6 +421,7 @@ dragonBones.ArmatureDisplay = cc.Class({
|
||||
|
||||
if (listenersBefore) {
|
||||
sgNode._bubblingListeners = listenersBefore; // using the listeners added before
|
||||
sgNode._hasListenerCache = listenersCacheBefore;
|
||||
if (CC_JSB && !sgNode.hasEventCallback()) {
|
||||
// In JSB, should set event callback of the new sgNode
|
||||
// to make the listeners work well.
|
||||
|
||||
Reference in New Issue
Block a user