Jump to content

Multiple PIXI.Application elements on a webpage?


Recommended Posts

I have a webpage which needs multiple Pixi elements stacked in different places of the page DOM.

Pixi elements are continuously created and destroyed as the webpage is used. At the most there will be 5 Pixi elements used/shown at once. The Pixi elements have their own scope and functionality, and does not need to "know" about each other.

I have to avoid memory leaks as the page can be used for quite some time. Pixi elements can be created and destroyed for hundreds of times while the webpage are in use

Is it good practice just to keep creating and destroying multiple PIXI.Applications (and show multiple at once)?

this.app = new PIXI.Application();

// Use component

// Finished
this.app.destroy(true, true);


Or should I try to clean and re-use the Pixi.Application instances? Or should I do this in a different way?



Edited by Agile
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...