common-game
Advanced tools
Comparing version 0.0.45 to 0.0.46
{ | ||
"name": "common-game", | ||
"version": "0.0.45", | ||
"version": "0.0.46", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "common-game.js", |
@@ -120,9 +120,13 @@ import * as PIXI from "@tbminiapp/pixi-miniprogram-engine"; | ||
initGameApplication(canvas, options) { | ||
console.log('initGameApplication'); | ||
const application = this.app = new PIXI.Application({ | ||
view: canvas, | ||
...options | ||
}); | ||
const context = application.renderer instanceof PIXI.CanvasRenderer ? application.renderer.context : application.renderer.gl; | ||
this.props.onAppInit && this.props.onAppInit.call(this, { canvas, context, options, application }); | ||
console.log('initGameApplication', options); | ||
let obj = { canvas, options }; | ||
if (!options.noPIXI) { | ||
const application = this.app = new PIXI.Application({ | ||
view: canvas, | ||
...options | ||
}); | ||
const context = application.renderer instanceof PIXI.CanvasRenderer ? application.renderer.context : application.renderer.gl; | ||
Object.assign(obj, { context, application }); | ||
} | ||
this.props.onAppInit && this.props.onAppInit.call(this, Object.assign({}, obj)); | ||
}, | ||
@@ -129,0 +133,0 @@ onTouchHandle(event) { |
import Quadtree from './libs/quadtree';//四叉树 | ||
import { TweenMax } from './libs/greensock-js/src/esm/TweenMax';//补间动画 | ||
import * as TweenObj from './libs/greensock-js/src/esm/TweenMax';//补间动画 | ||
export default { | ||
export default Object.assign({}, TweenObj, { | ||
Quadtree, | ||
TweenMax, | ||
audioFun: function (audioSrc, audioGlobalName) { | ||
@@ -155,2 +154,2 @@ if (!audioSrc) { return false; } | ||
} | ||
} | ||
}) |
1945671
35112