Page 1 of 1

Love 2d showing black screen

Posted: Tue Sep 15, 2020 10:01 pm
by Lekic
Please i downloaded love2d some weeks ago then working with it with code compiler so yesterday when i wanted to run a code on it the love2d was just a black screen.please what happened and what can i do?

Re: Love 2d showing black screen

Posted: Wed Sep 16, 2020 12:52 pm
by AuahDark
Honestly I don't see anything wrong. What about this very little example? It should draw red and blue rectangle with white text.

Code: Select all

function love.draw()
    love.graphics.setColor(1, 0, 0)
    love.graphics.rectangle("fill", 10, 10, 20, 20)
    love.graphics.setColor(1, 1, 1)
    love.graphics.print("In white")
    love.graphics.setColor(0, 0, 1)
    love.graphics.rectangle("fill", 25, 25, 20, 20)
    love.graphics.setColor(1, 1, 1)
    love.graphics.print("In blue but actually white")
end

Re: Love 2d showing black screen

Posted: Wed Sep 16, 2020 3:07 pm
by Lekic
Still the same black screen 😕

Re: Love 2d showing black screen

Posted: Wed Sep 16, 2020 3:34 pm
by CogentInvalid
Your file should be named main.lua.

Re: Love 2d showing black screen

Posted: Wed Sep 16, 2020 8:10 pm
by Jeeper
Just like "CogentInvalid" pointed out, Löve requires you to name your main file "main.lua".
Also it would be best to share the file, rather than a printscreen. Bonus points if you do it in the "Support and Development"