demiculus

How can one develop with PIXI by using hot-reloading or hot-swaping?

Recommended Posts

Learn how those code reload things work, then make your own - put pixi app in part that is not hot-reloaded.

Of course PixiJS wasnt made with hot reload in mind, it could cost a lot of architecture changes to take it into account, so you have to modify all the resource management accordingly.

Edited by ivan.popelyshev

Share this post


Link to post
Share on other sites

naive approach - If you are working with hotswap editor like in codesandbox - you have to destroy pixi app on reload or all those applications will leave in memory. That's one of the problems to solve if you want a real hot swap

try {
  if (module.hot) {
    module.hot.dispose(function() {
      console.log("destroyed");
      app.destroy();
    });
  }
} catch (e) {}

 

Share this post


Link to post
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.

Guest
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.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.