I'm sure I've done this before, but I haven't done any coding of late and can't recall how to go about it:
I need to copy part of the back-buffer (or whatever its called these days), draw some stuff on it then copy it back to the screen before it's displayed. The part being copied, drawn to then copied back, is of constant size so doesn't need to be created on the fly. What's the quickest way to do this?
In other libraries I've used it would be a case of creating a new image, copying a quad to it from the back-buffer, setting it as the draw target, drawing then copying it back. I'm getting lost in canvases and imagedata on the wiki! No code example required, just a nudge in the right direction would be great.
TIA
Grab part of screen, draw, replace
Re: Grab part of screen, draw, replace
You can draw to an intermediate render target, then perform manipulations with it, and finally put it on the screen.
Re: Grab part of screen, draw, replace
Hehe yeah that's pretty much what I want to do (well, do a normal draw, copy part of that to the intermediate target etc) just can't see how atm
Re: Grab part of screen, draw, replace
To make it general, you need two canvases. One would be the back buffer, and the other the copied quad.
You would draw to the backbuffer canvas rather than to the screen, and in love.draw, you would draw the backbuffer to the screen.
To copy a quad, you need to draw that canvas on the second canvas.
There are probably better ways for specific usages.
You would draw to the backbuffer canvas rather than to the screen, and in love.draw, you would draw the backbuffer to the screen.
To copy a quad, you need to draw that canvas on the second canvas.
There are probably better ways for specific usages.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest