Page 1 of 2
Black screen
Posted: Fri Dec 15, 2023 1:26 pm
by Hastenmarlen
When try to start code, just open black screen of love. IDE-ZeroBrane
saving not help
windows 10-64
code-
function love.draw()
love.graphics.setColor( 1, 1, 1)
end
Re: Black screen
Posted: Fri Dec 15, 2023 4:15 pm
by dusoft
Well, you are literally not drawing anything, just setting a text color to something very close to black. Try with more code including examples and tutorials and then come back to forum, if the issue persists.
Re: Black screen
Posted: Fri Dec 15, 2023 5:33 pm
by Hastenmarlen
I've done this before, the code is for an example. No matter what I write, he's still black
Re: Black screen
Posted: Fri Dec 15, 2023 5:39 pm
by Bobble68
Hastenmarlen wrote: ↑Fri Dec 15, 2023 5:33 pm
I've done this before, the code is for an example. No matter what I write, he's still black
setColor only affects future instructions, what you are doing here is essentially telling the program 'next time I tell you to draw something, draw it this colour', but that's it. Without telling it what to draw, it will not do anything. You might be thinking of
love.graphics.setBackgroundColor instead.
dusoft wrote: ↑Fri Dec 15, 2023 4:15 pm
just setting a text color to something very close to black.
Not really sure what you mean here, (1,1,1) is pure white, and it effects most draw instructions, not just text.
Re: Black screen
Posted: Fri Dec 15, 2023 10:49 pm
by dusoft
Bobble68 wrote: ↑Fri Dec 15, 2023 5:39 pm
dusoft wrote: ↑Fri Dec 15, 2023 4:15 pm
just setting a text color to something very close to black.
Not really sure what you mean here, (1,1,1) is pure white, and it effects most draw instructions, not just text.
Ah yes, sorry, I always think in 0-255 interval of CSS colors. It does not matter after all, you just set the color and don't do anything else.
Re: Black screen
Posted: Fri Dec 15, 2023 11:18 pm
by pgimeno
Maybe you wanted to use love.graphics.setBackgroundColor instead?
Re: Black screen
Posted: Sat Dec 16, 2023 3:56 am
by Hastenmarlen
no, you didn't understand me, EVERYTHING I write doesn't output anything for, I tried every code that output something, nothing helps
Re: Black screen
Posted: Sat Dec 16, 2023 12:23 pm
by Bobble68
Hastenmarlen wrote: ↑Sat Dec 16, 2023 3:56 am
no, you didn't understand me, EVERYTHING I write doesn't output anything for, I tried every code that output something, nothing helps
Here's a small demo, see if this works.
Code: Select all
function love.draw()
local t = -love.timer.getTime()/4
love.graphics.setBackgroundColor( t%1, (t/3)%1, (t/7)%1)
end
Re: Black screen
Posted: Sun Dec 17, 2023 10:11 am
by Hastenmarlen
ok, the question is closed, I tried everything, nothing helped, I got tired of it and reinstalled Windows, after which everything worked
Re: Black screen
Posted: Sun Dec 17, 2023 1:02 pm
by MrFariator
If reinstalling your OS solved the issue, it might have been that your GPU's drivers were at fault. AMD driver 22.7.1 for example is known to cause love2d to output purely black visuals.