Permalink
Browse files

fixed #1463 CCBReader API compatible with JSB

  • Loading branch information...
1 parent 6d2375a commit 0b5811b81a5ca1ec098e9cba39fca3ffe7614329 @dingpinglv dingpinglv committed Nov 27, 2012
@@ -267,9 +267,12 @@ cc.Layer = cc.Node.extend(/** @lends cc.Layer# */{
// then iterate over all the children
this._super();
+ //TODO not supported
// add this layer to concern the Accelerometer Sensor
- if (this._isAccelerometerEnabled)
- director.getAccelerometer().setDelegate(this);
+/* if (this._isAccelerometerEnabled){
+ director.getAccelerometer().setDelegate(this);
+ }*/
+
// add this layer to concern the kaypad msg
if (this._isKeyboardEnabled)
@@ -289,9 +292,10 @@ cc.Layer = cc.Node.extend(/** @lends cc.Layer# */{
}
// remove this layer from the delegates who concern Accelerometer Sensor
- if (this._isAccelerometerEnabled) {
+ //TODO not supported
+/* if (this._isAccelerometerEnabled) {
director.getAccelerometer().setDelegate(null);
- }
+ }*/
// remove this layer from the delegates who concern the kaypad msg
if (this._isKeyboardEnabled) {
@@ -308,9 +312,10 @@ cc.Layer = cc.Node.extend(/** @lends cc.Layer# */{
* this is called when ever a layer is a child of a scene that just finished a transition
*/
onEnterTransitionDidFinish:function () {
- if (this._isAccelerometerEnabled) {
+ //TODO not supported
+ /*if (this._isAccelerometerEnabled) {
cc.Director.getInstance().getAccelerometer().setDelegate(this);
- }
+ }*/
this._super();
},
@@ -183,6 +183,10 @@ cc.BuilderAnimationManager = cc.Class.extend({
}
},
+ runAnimationsForSequenceNamed:function(name){
+ this.runAnimations(name);
+ },
+
runAnimations:function (name, tweenDuration) {
var nSeqId;
if(typeof(name) === "string")
@@ -243,6 +247,10 @@ cc.BuilderAnimationManager = cc.Class.extend({
this._animationCompleteCallbackFunc = callbackFunc;
},
+ setCompletedAnimationCallback:function(target,callbackFunc){
+ this.setAnimationCompletedCallback(target,callbackFunc);
+ },
+
debug:function () {
},
@@ -458,9 +466,17 @@ cc.BuilderAnimationManager = cc.Class.extend({
},
_sequenceCompleted:function () {
+ if(this._lastCompletedSequenceName != this._runningSequence.getName()){
+ this._lastCompletedSequenceName = this._runningSequence.getName();
+ }
+
if (this._delegate)
this._delegate.completedAnimationSequenceNamed(this._runningSequence.getName());
+ if(this._target && this._animationCompleteCallbackFunc){
+ this._animationCompleteCallbackFunc.call(this._target);
+ }
+
var nextSeqId = this._runningSequence.getChainedSequenceId();
this._runningSequence = null;
@@ -79,7 +79,8 @@ cc.SpriteLoader.loader = function () {
var PROPERTY_TOUCH_ENABLED = "isTouchEnabled";
var PROPERTY_ACCELEROMETER_ENABLED = "isAccelerometerEnabled";
-var PROPERTY_MOUSE_ENABLED = "isMouseEnabled";
+var PROPERTY_IS_MOUSE_ENABLED = "isMouseEnabled";
+var PROPERTY_MOUSE_ENABLED = "mouseEnabled";
var PROPERTY_KEYBOARD_ENABLED = "isKeyboardEnabled";
cc.LayerLoader = cc.NodeLoader.extend({
@@ -91,9 +92,8 @@ cc.LayerLoader = cc.NodeLoader.extend({
node.setTouchEnabled(check);
} else if (propertyName == PROPERTY_ACCELEROMETER_ENABLED) {
node.setAccelerometerEnabled(check);
- } else if (propertyName == PROPERTY_MOUSE_ENABLED) {
- // TODO XXX
- cc.log("The property '" + PROPERTY_MOUSE_ENABLED + "' is not supported!");
+ } else if (propertyName == PROPERTY_IS_MOUSE_ENABLED || propertyName == PROPERTY_MOUSE_ENABLED ) {
+ node.setMouseEnabled(check)
} else if (propertyName == PROPERTY_KEYBOARD_ENABLED) {
// TODO XXX
cc.log("The property '" + PROPERTY_KEYBOARD_ENABLED + "' is not supported!");

0 comments on commit 0b5811b

Please sign in to comment.