Love 2d showing black screen

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Lekic
Prole
Posts: 5
Joined: Tue Sep 15, 2020 9:56 pm

Love 2d showing black screen

Post by Lekic » Tue Sep 15, 2020 10:01 pm

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?
Attachments
Screenshot_20200914-074126.png
Screenshot_20200914-074126.png (14.88 KiB) Viewed 1811 times
Screenshot_20200914-074138.png
Screenshot_20200914-074138.png (112.66 KiB) Viewed 1811 times

User avatar
AuahDark
Citizen
Posts: 67
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: Love 2d showing black screen

Post by AuahDark » Wed Sep 16, 2020 12:52 pm

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
Profile. I don't always online in forum, so Discord is preferred. Am I LÖVE for Android dev or not? Only you can tell.

Lekic
Prole
Posts: 5
Joined: Tue Sep 15, 2020 9:56 pm

Re: Love 2d showing black screen

Post by Lekic » Wed Sep 16, 2020 3:07 pm

Still the same black screen 😕

User avatar
CogentInvalid
Prole
Posts: 22
Joined: Sat Dec 14, 2013 12:15 am

Re: Love 2d showing black screen

Post by CogentInvalid » Wed Sep 16, 2020 3:34 pm

Your file should be named main.lua.

User avatar
Jeeper
Party member
Posts: 572
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Love 2d showing black screen

Post by Jeeper » Wed Sep 16, 2020 8:10 pm

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"

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 18 guests