Quickie Darkening Screen?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
slipher
Prole
Posts: 2
Joined: Tue Jan 20, 2015 11:14 pm

Quickie Darkening Screen?

Post 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?
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Quickie Darkening Screen?

Post by Jasoco »

We're gonna need more code. Because none of the stuff you posted will help.
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Re: Quickie Darkening Screen?

Post 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.
slipher
Prole
Posts: 2
Joined: Tue Jan 20, 2015 11:14 pm

Re: Quickie Darkening Screen?

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], slime and 6 guests