JeanLouis Posted August 10, 2023 Share Posted August 10, 2023 (edited) Hello, Let's say I have 2 containers : - background, to display the map (land and water, basically) -> zIndex 0 - entities (npc, buildings..) -> zIndex > 0 (from 1 to 100) I would like to avoid to draw background each time on the loop, because this background actually never changes. The entities are drawn in front of the background, and they can change, for example when a NPC move. Before using PIXI I had multiples canvases, one for the background, and the others for the entities, and the entities canvases were drawn in front of the background one. This way, I could draw background only one time and then, do whatever I want with the second canvas (clearing the entities canvas doesn't affect the background canvas). So I would like to do the same with PIXI but : would it be possible to draw background only once, keep it displayed, and render the entities on each loop ? Please note that I use webworker, so if I understand well, I can use only PIXI.Application, because the others classes don't have the view option - in my case, I have to send the offscreencanvas to the worker Thanks ! Edited August 13, 2023 by JeanLouis Quote Link to comment Share on other sites More sharing options...
JeanLouis Posted August 27, 2023 Author Share Posted August 27, 2023 Is my question so newbie that no one wants to spend some time on it ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.