schellingb / LoveWebBuilder

Package, build and run LÖVE games for the web - https://schellingb.github.io/LoveWebBuilder/
Other
41 stars 7 forks source link

Black Screen #1

Open sysl-dev opened 6 years ago

sysl-dev commented 6 years ago

I'm not sure what is causing it, but all my graphics seems to be black, while input appears to be working.

I'm trying with https://systemlogoff.itch.io/trimono

Is it a colors thing? Or is it a Canvas thing?

Thank you for working on this tool, I'm looking forward to using it for future game jams.

schellingb commented 6 years ago

Hi there

I poked around a bit and it turns out love.window.setMode seems to not work at all! While it successfully resizes the web canvas it's just a black screen from then on. So for Trimono I changed these lines in conf.lua and lovepixels.lua

t.window.width = 160*4
t.window.height = 144*4
function lovePixels:resizeScreen(newScale)
    if love.system.getOS() == 'Web' then
        lovePixels.scale = 4 --fixed scale on web
    else
        lovePixels.scale = newScale
        love.window.setMode(pixelWidth * lovePixels.scale, pixelHeight * lovePixels.scale, {})
    end
end

Also I had to remove the seemingly unused '_shaders.lua' because at least my current Chrome version on my PC doesn't like any custom shaders. In Firefox shaders run fine.

With that and memory set to 64MB it ran fine! I finished it even :-)

I added a hint to the top page about setMode not working.

sysl-dev commented 6 years ago

Thank you, I'm glad it's just setmode being strange. Looking forward to using it next jam. 😀