Page 1 of 1

Quickie Darkening Screen?

Posted: Fri Jan 23, 2015 1:48 am
by slipher
Hello!

I'm using HUMP for my gamestates and Quickie for my GUI. I've been able to use Quickie and the gamestates fine but I'm running into an issue that I could not find elsewhere on the forum.

Quickie (I believe) seems to darken the window for some reason and it makes things really hard to see. Whenever I click on a button to go to the next gamestate the screen is really dark.

Code: Select all

  
if gui.Button("Defend", 565, 540, 150, 30) then
    Gamestate.switch(defend)
end
However, if I switch to the other gamestate using Gamestate.switch(defend) in love.load() it doesn't have this darkening effect. I'm also not using any GUI elements anywhere except the menu gamestate. The only draw code I have for the GUI is in my Menu gamestate and not in any of my other gamestates.

Code: Select all

function Menu:draw()
  love.graphics.draw(menuBackground, 0, 0)
  gui.core.draw()
end
Pic:
Image

Is there anyway to fix this?

Re: Quickie Darkening Screen?

Posted: Fri Jan 23, 2015 2:52 am
by Jasoco
We're gonna need more code. Because none of the stuff you posted will help.

Re: Quickie Darkening Screen?

Posted: Fri Jan 23, 2015 3:46 am
by Azhukar
Seems like you're not using love.graphics.setColor(255,255,255,255) before drawing your images, causing setColor from the UI to leak into your other draw calls.

Always set the color to what you want it to be before drawing anything that uses the color property, you can never rely on an unknown state. This means if you are drawing 10 consecutive images and you know nothing can change the color between them, you can use a single setColor before drawing them.

Re: Quickie Darkening Screen?

Posted: Fri Jan 23, 2015 8:07 am
by slipher
Azhukar wrote:Seems like you're not using love.graphics.setColor(255,255,255,255) before drawing your images, causing setColor from the UI to leak into your other draw calls.

Always set the color to what you want it to be before drawing anything that uses the color property, you can never rely on an unknown state. This means if you are drawing 10 consecutive images and you know nothing can change the color between them, you can use a single setColor before drawing them.
This fixed everything perfectly. Thank you so much.