Skip to content

Commit

Permalink
restore compatibility with the legacy pool system
Browse files Browse the repository at this point in the history
  • Loading branch information
obiot committed Aug 21, 2024
1 parent beaece4 commit 8904aa0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/melonjs/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ export function boot() {
pool.register("me.Renderable", Renderable);
pool.register("me.Text", Text, true);
pool.register("me.BitmapText", BitmapText);
pool.register("me.ImageLayer", ImageLayer);
pool.register("me.Tween", Tween);
pool.register("me.ColorLayer", ColorLayer, true);
// duplicate all entries if use with no namespace (e.g. es6)
pool.register("Entity", Entity);
Expand All @@ -223,6 +225,7 @@ export function boot() {
pool.register("Text", Text, true);
pool.register("BitmapText", BitmapText);
pool.register("ImageLayer", ImageLayer);
pool.register("Tween", Tween);
pool.register("ColorLayer", ColorLayer, true);

// publish Boot notification
Expand Down
7 changes: 7 additions & 0 deletions packages/melonjs/src/tweens/tween.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ export default class Tween<T extends Record<string, unknown>> {
this.#boundResumeCallback = this._resumeCallback.bind(this);
}

/**
* @ignore
*/
onResetEvent(object: T) {
this.setProperties(object);
}

/**
* @ignore
*/
Expand Down

0 comments on commit 8904aa0

Please sign in to comment.