vornay Posted March 2, 2021 Share Posted March 2, 2021 Can PixiJS be used to create an animated video on the canvas, and have each frame be processed by something like a video encoder to make a movie file of the animation? It would be OK if it ran slow. The video encoding would also be done in JS, so PixiJS might have to pause after each frame of the animation until the video encoder was done. Also, can PixiJS render "layers" that are stacked, for example, a background layer and a foreground layer? (like in an endless runner game) Quote Link to comment Share on other sites More sharing options...
Exca Posted March 2, 2021 Share Posted March 2, 2021 You could extract the frames from canvas with toDataUrl or use the extract plugin to get the actual pixel data of a single frame. Then gather all of the frames and encode them into a video with some encoder, dunno if those exist in the browser, most likely someone has made one. You can do stacked rendering with multiple different ways. - Have 2 containers that move with different speeds. - Use overlapping canvases with each having their own renderer and move them. - Have each of your object in the scene have a depth value and move everything based on that. - Use rendertextures to create the stage and use those with tilingsprite and offset them at different speeds. Different methods have different limitations & benefits. vornay 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.