Jump to content

Adding new graphics socket.io message callback makes app crash over a time.


maassk
 Share

Recommended Posts

Hello,

I am new with Pixi.js and I have a problem with adding new graphic dynamically. There is no problem with drawing large number of rectangles all at once but when I try to draw them in a batches when responce from socket.io server comes, then app is crashing at some point due to out of memory. Any advices on drawing graphics dynamically from a callback function?

Thank you in advance!

Link to comment
Share on other sites

when I try to draw them in a batches when responce from socket.io server comes,

PixiJS has a scene, and it draws scene only when "renderer.render()" is called.

If you are talking about "graphics.drawRect", you actually adding one more rect into graphics storage, not removing all the previous ones. Graphics is clear&refill system, where are you doing clear?

What exactly are you doing in that response?

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.

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

  • Recently Browsing   0 members

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