Page 1 of 1
Can Canvasses have Background Colour?
Posted: Fri Dec 30, 2016 10:07 pm
by MicroMacro
Title says all. I'm trying to get a cool effect where my canvas (which coincidentally is the same size as my physics area) has a different colour than the rest of the background.
I suppose I could just add a rectangle the size of the canvas before everything else on the canvas, but I wanted to know if background colours are possible.
Thanks!
Re: Can Canvasses have Background Colour?
Posted: Fri Dec 30, 2016 10:09 pm
by raidho36
There is a command to clear entire canvas to a solid color (and alpha) - [wiki]love.graphics.clear[/wiki].
If you wanted to know if Canvas objects have such property - no, they do not. Canvas is a region of VRAM with some contents, it doesn't have parameters beyond pixel format and resolution (also filtering type, since it also acts as a texture).
Re: Can Canvasses have Background Colour?
Posted: Fri Dec 30, 2016 10:37 pm
by MicroMacro
Thanks! I already was using love.graphics.clear(), didn't know it could pass colours. Woop!
Re: Can Canvasses have Background Colour?
Posted: Sat Dec 31, 2016 9:54 am
by zorg
That's what the wiki's there for!
[wiki]love.graphics.clear[/wiki]