Record the game as movie file

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
deb75
Prole
Posts: 38
Joined: Sun Apr 18, 2021 1:11 pm

Record the game as movie file

Post by deb75 »

Hello,

I would like to record the game play as a movie file.

I am pretty sure it should be possible at least to save each frame drawn by love.

Is there a function in love API with which I can retrieve the full image built at the end of love.draw()

For example, like this :

Code: Select all

function love.draw()
      -- draw all game objects --
      img = love.window.getFrame()
      love.filesystem.save(img, string.format("img_%d.png", i))
      i = i + 1
end


Of course, it might slow fown the game, but at the end, I can make a movie from all "img_%d.png" file with .e.g. ffmpeg.

Is it possible to do something like this ?

Regards

EDIT :

I think it is possible by drawing everything at first to a canvas.

Indeed, the canvas API has the function "newImageData()" which generates an image from the canvas data.

In my game, that would require to draw a canvas into another canvas, is it possible ?

Regards
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Record the game as movie file

Post by ReFreezed »

Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests