Page 1 of 1

Manipulating an Image or something

Posted: Sun Jan 01, 2012 6:46 pm
by pauloborges
Hello, Lovers!

It is possible to draw using, for example, primitives (like quad, line and circle) directly into an Image (maybe an ImageData and converting it to an Image after)? Or the only way to draw not into screen is via framebuffer (using framebuffer:renderTo)?

Sorry for the creepy english! I'm far away from any english-speaker country.

Re: Manipulating an Image or something

Posted: Tue Jan 03, 2012 11:31 am
by pauloborges
no one can help me?

:cry: :cry:

Re: Manipulating an Image or something

Posted: Tue Jan 03, 2012 11:32 am
by bartbes
No, you can only do regular drawing to a framebuffer (or the screen), you can do pixel manipulation on ImageData directly, if you're desperate.

Re: Manipulating an Image or something

Posted: Wed Jan 04, 2012 9:25 pm
by Jasoco
I would use FrameBuffers. (Canvases in 0.8) I use them all the time now. But they're not 100% supported across the entire community. Some graphics cards don't like them at all, some have limits, others (Like my MacBook Pro and Air) support a really high amount. But they are great in that you create a blank buffer/canvas and clear it with whatever color you want, draw all your stuff to it then draw that to the screen or another buffer/canvas.

You clear it manually in the newest versions (I can't remember if clearing is required in 0.8 or 0.7.2) which is really useful so you can draw to it over time and not have to redraw everything over and over. Really useful if you want to have a canvas specifically for blood spatters or paint spatters or bullet holes or anything that adds detail, but would be too costly CPU cycle wise to redraw every single frame. You'd just draw the "spatter" canvas in between the world and the characters.

We had a poll a while ago to see which members had graphics cards that supported how many buffers. I forget the outcome. If worse comes to worse, you'd have to design the game to not require them, but have fallbacks for when they aren't supported even if it means more processing cycles are needed.