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

Difference between rendering a Container and rendering a RenderTexture

$
0
0

I am confused with the two main methods to animate objects in pixi.js.

The first one is to build a sprite and put it in a PIXI.Container. I can then add this container as a child of the PIXI stage. Every tick of the animation I just need to update the sprite's position and PIXI will handle the rest for me.

I can also build a sprite or a displayObject and create a RenderTexture which is about the same size of what I want to render. Then I use 

renderer.render(DisplayObject, RenderTexture); 

to render it on the screen. This works fine too. I still need to update the position on every tick so the displayObject will animate.

But what is the difference between using a Container and a RenderTexture? There must be a reason we have two options to render something. What use cases are these two methods best fitted in?


Viewing all articles
Browse latest Browse all 3978

Trending Articles



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