File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
extensions/cocostudio/action Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ ccs.ActionNode = ccs.Class.extend(/** @lends ccs.ActionNode# */{
6464 initWithDictionary : function ( dic , root ) {
6565 this . setActionTag ( dic [ "ActionTag" ] ) ;
6666 var actionFrameList = dic [ "actionframelist" ] ;
67+
68+ var node = ccui . helper . seekWidgetByName ( root , dic [ "name" ] ) ;
69+ var positionOffset = node instanceof ccui . Widget && ! ( node instanceof ccui . Layout ) ;
70+
6771 for ( var i = 0 ; i < actionFrameList . length ; i ++ ) {
6872 var actionFrameDic = actionFrameList [ i ] ;
6973 var frameIndex = actionFrameDic [ "frameid" ] ;
@@ -82,6 +86,11 @@ ccs.ActionNode = ccs.Class.extend(/** @lends ccs.ActionNode# */{
8286 if ( actionFrameDic [ "positionx" ] !== undefined ) {
8387 var positionX = actionFrameDic [ "positionx" ] ;
8488 var positionY = actionFrameDic [ "positiony" ] ;
89+ if ( positionOffset && node . parent ) {
90+ var AnchorPointIn = node . parent . getAnchorPointInPoints ( ) ;
91+ positionX += AnchorPointIn . x ;
92+ positionY += AnchorPointIn . y ;
93+ }
8594 actionFrame = new ccs . ActionMoveFrame ( ) ;
8695 actionFrame . frameIndex = frameIndex ;
8796 actionFrame . setEasingType ( frameTweenType ) ;
You can’t perform that action at this time.
0 commit comments