How to copy Webgl content to another canvas element without create new Pixi.application
See original GitHub issueHi all,
How to do the result like pure html canvas for redraw canvasA’s content to canvasB.
Here is the result i wished:
var canvasA = document.getElementById("canvasA");
var ctxA = canvasA.getContext("2d");
//ctxA drawsomthing......
...
...
var canvasB = document.getElementById("canvasB");
var ctxB = canvasB.getContext("2d");
ctxB.drawImage(canvasA, 0, 0, canvasB.width, canvasB.height);
How to do it in Pixi.jsV4 By the way, my renderer is ‘Webgl context’
Thanks a lot!
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
Is it possible to change the canvas element of a WebGL context?
Moving WebGL contexts to different canvases is not currently possible. Does this technique not work for you?
Read more >How to use PIXI.Application() when there is already a canvas ...
I am using pixi.js version 5.2.0 to create a word app at Facebook and your library ... But I already have a canvas...
Read more >PIXI.Application - PixiJS API Documentation
Convenience class to create a new PixiJS application. This class automatically creates the renderer, ticker and root container. new PIXI.
Read more >Building an Images Gallery using PixiJS and WebGL
Add the PixiJS library as a script in the HTML. Have a <canvas> element (or add it dynamically from Javascript), to render the...
Read more >Pixi.js Tutorial For Complete Beginners - Create 2D ... - YouTube
In this tutorial, we're going to learn the fundamental parts of the Javascript library Pixi.js, such as creating and adding elements to the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Really helpful, thanks
Application is a mashup: https://github.com/pixijs/pixi.js/blob/dev/src/core/Application.js , it has Renderer, ticker and stage inside.
Juts make two renderers instead of one and render the same stage.
You can customize some params, like transform applied to stage, if you look at render documentation