diff --git a/src/core/const.js b/src/core/const.js index 9366125..3557cf7 100644 --- a/src/core/const.js +++ b/src/core/const.js @@ -309,6 +309,12 @@ HIGH: 'highp' }, + TRANSFORM_MODE:{ + STATIC:0, + DYNAMIC:1, + DEFAULT:0 + }, + // TODO: maybe change to SPRITE.BATCH_SIZE: 2000 // TODO: maybe add PARTICLE.BATCH_SIZE: 15000 SPRITE_BATCH_SIZE: 4096, //nice balance between mobile and desktop machines diff --git a/src/core/const.js b/src/core/const.js index 9366125..3557cf7 100644 --- a/src/core/const.js +++ b/src/core/const.js @@ -309,6 +309,12 @@ HIGH: 'highp' }, + TRANSFORM_MODE:{ + STATIC:0, + DYNAMIC:1, + DEFAULT:0 + }, + // TODO: maybe change to SPRITE.BATCH_SIZE: 2000 // TODO: maybe add PARTICLE.BATCH_SIZE: 15000 SPRITE_BATCH_SIZE: 4096, //nice balance between mobile and desktop machines diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 035440c..f072f43 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -1,7 +1,8 @@ var math = require('../math'), EventEmitter = require('eventemitter3'), - Transform = require('./TransformStatic'), - // Transform = require('./Transform'), + CONST = require('../const'), + TransformStatic = require('./TransformStatic'), + Transform = require('./Transform'), _tempDisplayObjectParent = new DisplayObject(); @@ -18,12 +19,14 @@ { EventEmitter.call(this); + var TransformClass = CONST.TRANSFORM_MODE.DEFAULT === CONST.TRANSFORM_MODE.STATIC ? TransformStatic : Transform; + //TODO: need to create Transform from factory /** * World transform and local transform of this object. * This will be reworked in v4.1, please do not use it yet unless you know what are you doing! */ - this.transform = new Transform(); + this.transform = new TransformClass(); /** * The opacity of the object.