diff --git a/examples/src/spriteAnimation.ts b/examples/src/spriteAnimation.ts index 67230d91..a1ba1d8e 100644 --- a/examples/src/spriteAnimation.ts +++ b/examples/src/spriteAnimation.ts @@ -48,14 +48,14 @@ export async function init(canvas) { ); frame.play(4); - frame.on('onComplete', () => { - console.log('onComplete'); + frame.on('complete', () => { + console.log('complete'); }); - frame.on('onLoop', () => { - console.log('onLoop'); + frame.on('loop', () => { + console.log('loop'); }); - frame.on('onFrameChange', () => { - console.log('onFrameChange'); + frame.on('frameChange', () => { + console.log('frameChange'); }); game.scene.addChild(cut); diff --git a/packages/eva.js/lib/game/Game.ts b/packages/eva.js/lib/game/Game.ts index 5256dd80..1f14d0e8 100644 --- a/packages/eva.js/lib/game/Game.ts +++ b/packages/eva.js/lib/game/Game.ts @@ -5,7 +5,7 @@ import System from '../core/System'; import Component from '../core/Component'; import { setSystemObserver, initObserver } from '../core/observer'; import EventEmitter from 'eventemitter3'; -import type { RendererSystemParams } from 'packages/plugin-renderer/lib/System'; + /** eva plugin struct */ export interface PluginStruct { @@ -35,7 +35,26 @@ export enum LOAD_SCENE_MODE { interface LoadSceneParams { scene: Scene; mode?: LOAD_SCENE_MODE; - params?: RendererSystemParams; + params?: { + width?: number; + height?: number; + canvas?: HTMLCanvasElement + renderType?: number + autoStart?: boolean; + sharedTicker?: boolean; + sharedLoader?: boolean; + transparent?: boolean; + antialias?: boolean; + preserveDrawingBuffer?: boolean; + resolution?: number; + backgroundColor?: number; + clearBeforeRender?: boolean; + roundPixels?: boolean; + forceFXAA?: boolean; + legacy?: boolean; + autoResize?: boolean; + powerPreference?: "high-performance"; + }; } const triggerStart = (obj: System | Component) => { diff --git a/packages/plugin-matterjs/lib/PhysicsSystem.ts b/packages/plugin-matterjs/lib/PhysicsSystem.ts index e563d4fc..06fb9711 100644 --- a/packages/plugin-matterjs/lib/PhysicsSystem.ts +++ b/packages/plugin-matterjs/lib/PhysicsSystem.ts @@ -90,7 +90,7 @@ export default class PhysicsSystem extends System { switch (changed.type) { case OBSERVER_TYPE.CHANGE: { if ((changed.component as Transform).parent) { - let physics = changed.gameObject.getComponent(Physics) as Physics; + let physics = changed.gameObject.getComponent(Physics); if (physics && !physics.body) { this.engine.add(physics); } diff --git a/packages/plugin-matterjs/package.json b/packages/plugin-matterjs/package.json index 9487fe18..5c987c7e 100644 --- a/packages/plugin-matterjs/package.json +++ b/packages/plugin-matterjs/package.json @@ -19,9 +19,7 @@ "homepage": "https://eva.js.org", "dependencies": { "@eva/eva.js": "1.1.6-alpha.4", + "@types/matter-js": "^0.17.5", "poly-decomp": "^0.3.0" - }, - "devDependencies": { - "@types/matter-js": "^0.17.5" } } diff --git a/packages/renderer-adapter/lib/Application.ts b/packages/renderer-adapter/lib/Application.ts index 53c2ff5c..78a3d2f8 100644 --- a/packages/renderer-adapter/lib/Application.ts +++ b/packages/renderer-adapter/lib/Application.ts @@ -2,7 +2,7 @@ import { Application as PIXIApplication } from 'pixi.js'; import type { ApplicationOptions } from "pixi.js"; export default class Application extends PIXIApplication { - constructor(params?: ApplicationOptions) { + constructor(params: ApplicationOptions) { params.autoStart = false; super(params); }