Search the Community
Showing results for tags 'transformations'.
-
Container transformations don't apply when rendering on texure?
NessEngine posted a topic in Pixi.js
I try to render a container over a renderable texture, but the container transformations simply do not apply on the sprites inside. You can see it happens by taking the following code: var renderer = PIXI.autoDetectRenderer(800, 600,{backgroundColor : 0x1099bb}); document.body.appendChild(renderer.view); // create the root of the scene graph var stage = new PIXI.Container(); // create a new Sprite using the texture var texture = PIXI.Texture.fromImage('_assets/basics/bunny.png'); var bunny = new PIXI.Sprite(texture); // move the sprite to the center of the screen bunny.position.x = 200; bunny.position.y = 150; // create render texture and sprite var render_texture = new PIXI.RenderTexture(renderer, 800, 800); var render_texture_sprite = new PIXI.Sprite(render_texture); stage.addChild (render_texture_sprite); // create a container and add sprite to it var container = new PIXI.Container(); container.addChild(bunny); // these transformations will NOT apply, for some reason.. container.scale.x = 100; container.position.y = 100; // ???? // start animating animate(); function animate() { requestAnimationFrame(animate); render_texture.render(container); renderer.render(stage); } And paste it here http://pixijs.github.io/examples/ Is this a bug? or expected behavior? How do I make the container apply its transformations on the sprite? Thanks!- 2 replies
-
- transformations
- rendertexture
-
(and 1 more)
Tagged with: