Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3979

Remove or Destroy Sprite

$
0
0

I am creating multiple sprites from same texture in PIXI v5, I have few questions:

 

1. When I am not going to use specific sprite anymore, do I need to remove the sprite from container with container.removeChild(sprite) before calling sprite.destroy()?

I call destroy without arguments because I don't want to destroy the texture which I might use later to create more sprites.

 

2. What is the difference between calling container.removeChild(sprite) and sprite.destroy(without arguments)?

Does the GC collect everything regarding the sprite in either way? (except the texture which is in the GPU memory).

 

Thanks!


Viewing all articles
Browse latest Browse all 3979

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>