File tree Expand file tree Collapse file tree
plugins/spine/src/gameobject Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77var Class = require ( '../../../../src/utils/Class' ) ;
88var ComponentsAlpha = require ( '../../../../src/gameobjects/components/Alpha' ) ;
99var ComponentsBlendMode = require ( '../../../../src/gameobjects/components/BlendMode' ) ;
10+ var ComponentsComputedSize = require ( '../../../../src/gameobjects/components/ComputedSize' ) ;
1011var ComponentsDepth = require ( '../../../../src/gameobjects/components/Depth' ) ;
1112var ComponentsFlip = require ( '../../../../src/gameobjects/components/Flip' ) ;
1213var ComponentsScrollFactor = require ( '../../../../src/gameobjects/components/ScrollFactor' ) ;
@@ -33,6 +34,7 @@ var SpineGameObject = new Class({
3334 Mixins : [
3435 ComponentsAlpha ,
3536 ComponentsBlendMode ,
37+ ComponentsComputedSize ,
3638 ComponentsDepth ,
3739 ComponentsFlip ,
3840 ComponentsScrollFactor ,
@@ -60,6 +62,9 @@ var SpineGameObject = new Class({
6062
6163 this . timeScale = 1 ;
6264
65+ this . displayOriginX = 0 ;
66+ this . displayOriginY = 0 ;
67+
6368 this . setPosition ( x , y ) ;
6469
6570 if ( key )
@@ -136,6 +141,15 @@ var SpineGameObject = new Class({
136141
137142 this . root = this . getRootBone ( ) ;
138143
144+ var w = this . skeletonData . width ;
145+ var h = this . skeletonData . height ;
146+
147+ this . width = w ;
148+ this . height = h ;
149+
150+ this . displayOriginX = w / 2 ;
151+ this . displayOriginY = h / 2 ;
152+
139153 return this ;
140154 } ,
141155
You can’t perform that action at this time.
0 commit comments