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

PixiJS: Baking PIXI.Container to a PIXI.Texture

$
0
0

Hello, is it possible somehow to 'bake' a PixiJS container to texture.

let container = new PIXI.Container();
container.x = 256;
container.y = 256;

let graphics = new PIXI.Graphics();

graphics.beginFill(0xFF00FF);
graphics.drawRoundedRect(0, 0, 128, 128, 16);
graphics.endFill();

container.addChild(graphics);

let arrow = PIXI.Sprite.from(resources.arrowOut.texture);
arrow.x = 64 - arrow.width / 2;
arrow.y = 64 - arrow.height / 2;
container.addChild(arrow);

container.cacheAsBitmap = true;
        
app.stage.addChild(container);

Since if there is .cacheAsBitmap option, it has to be cached somewhere and I want to use it further as PIXI.Texture.

Screenshot from 2022-10-11 12-04-15.png


Viewing all articles
Browse latest Browse all 3978

Trending Articles



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