Page 2 of 2

Re: No blend mode.

Posted: Tue Jun 09, 2009 2:38 pm
by Robin
Something for the feature tracker?

Re: No blend mode.

Posted: Tue Jun 09, 2009 4:53 pm
by rude
Like I said. Render targets.

It will require GL_EXT_framebuffer_object, which might not be supported by older machines. Then again, can't let older machines hold us back forever.

Hopefully, it is possible to get the pixel data in a framebuffer. Otherwise display mode changes will be impossible.

Re: No blend mode.

Posted: Tue Jun 09, 2009 5:03 pm
by osgeld
love really doesnt run all that well on older machines anyway

Re: No blend mode.

Posted: Tue Jun 09, 2009 5:16 pm
by rude
Good point. :rofl:

Re: No blend mode.

Posted: Thu Jun 11, 2009 8:04 pm
by Jake
Alternatively you could just draw the quarters of the circles so no actual overlaying occurs. If it's an image you can draw the 'subsprite' (draws) of a corner of the circle.

EDIT: OH MY GOSH! I've just realised I spelled obey wrong in my avatar. Why has nobody told me :cry:

Re: No blend mode.

Posted: Mon Jun 29, 2009 9:04 am
by CryoNox
Jake: your avatar is hardly visible ^^

Everyone: I've been trying to alpha blend my images too:

Code: Select all

local oldcolor = love.graphics.getColor()
	love.graphics.setColor(255, 255, 255, 128)

	love.graphics.draw(	img["loveBG"],
						love.graphics.getWidth()*0.5,
						love.graphics.getHeight()*0.5)

	love.graphics.setColor(oldcolor)
It doesn't work though, anyone knows why?

Re: No blend mode.

Posted: Mon Jun 29, 2009 10:33 am
by rude
CryNox: love.graphics.setColorMode(love.color_modulate)

Re: No blend mode.

Posted: Mon Jun 29, 2009 3:54 pm
by CryoNox
rude: I tried that already:

Code: Select all

function MenuState:draw()
	local oldcolor = love.graphics.getColor()

	love.graphics.setBlendMode(love.color_modulate)
	love.graphics.setColor(255, 255, 255, 0)

	love.graphics.draw(	img["loveBG"],
						love.graphics.getWidth()*0.5,
						love.graphics.getHeight()*0.5)

	love.graphics.setColor(oldcolor)
	love.graphics.setBlendMode(0)
end
The image is supposed to be completely transparent, seeing that the alpha value is 0. However, it is more like 50% alpha. I get the same result even after I changed it to 255 or any other value. I attached a screenshot to show you what I mean.

Any ideas guys?

Re: No blend mode.

Posted: Mon Jun 29, 2009 4:37 pm
by CryoNox
I tried adjusting the alpha for text and it works. Strangely though, the images remain 50% alpha all the time, even when I set the alpha value to 0 - causing the text to disappear of course.

For some reason adjusting the alpha value only works for text and not images. Is there a solution to this?

EDIT: I attached my project if you want to check it out. For some reason, one of the images "loveBG.png" failed to load after I made the project into a .love file. I created that image using Photoshop CS3, and it worked when I ran the project before making it into a .love file. Just click "Continue" if you have the "failed to load" error.

Re: No blend mode.

Posted: Mon Jun 29, 2009 5:35 pm
by CryoNox
ARGH I JUST REALIZED MY STUPID MISTAKE:

I did this:
love.graphics.setBlendMode(love.color_modulate)

instead of this:
love.graphics.setColorMode(love.color_modulate)

lol.