Sorry about this guys, but this has been trouble for a while
-
- Prole
- Posts: 14
- Joined: Fri Nov 02, 2012 12:47 am
Sorry about this guys, but this has been trouble for a while
Hey again, sorry for 2 error posts in a night (please alarm me if there's a better place to go for help, I'm quite a newbie here in the community ), but lets say that I used love.graphics.setColor(blah) and then did something, but then attempted to draw a sprite or do something without wanting any color effects, how would I go about doing that?
Re: Sorry about this guys, but this has been trouble for a w
Hi!
One way to do it would be to change the color to white before drawing the next thing:
Another way to do it would be to change the color mode. The way color affects what is drawn can be changed using love.graphics.setColorMode (the different color modes are here: ColorMode)
By default, the color mode is "modulate". Changing it to "replace" will make what you draw afterwards unaffected by the current color.
One way to do it would be to change the color to white before drawing the next thing:
Code: Select all
love.graphics.setColor(255, 0, 0)
love.graphics.circle('fill', 200, 200, 50) -- A red circle
love.graphics.setColor(255, 255, 255)
love.graphics.draw(sprite, 10, 10)
By default, the color mode is "modulate". Changing it to "replace" will make what you draw afterwards unaffected by the current color.
Code: Select all
love.graphics.setColorMode('modulate')
love.graphics.setColor(255, 0, 0)
love.graphics.circle('fill', 200, 200, 50) -- A red circle
love.graphics.setColorMode('replace')
love.graphics.draw(sprite, 10, 10)
Who is online
Users browsing this forum: Bing [Bot] and 2 guests