No blend mode.

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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: No blend mode.

Post by Robin »

Something for the feature tracker?
Help us help you: attach a .love.
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: No blend mode.

Post 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.
User avatar
osgeld
Party member
Posts: 303
Joined: Sun Nov 23, 2008 10:13 pm

Re: No blend mode.

Post by osgeld »

love really doesnt run all that well on older machines anyway
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: No blend mode.

Post by rude »

Good point. :rofl:
User avatar
Jake
Prole
Posts: 27
Joined: Sun Jul 20, 2008 2:01 pm

Re: No blend mode.

Post 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:
User avatar
CryoNox
Prole
Posts: 18
Joined: Sun Jun 28, 2009 2:25 pm
Location: Singapore

Re: No blend mode.

Post 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?
Thy father beckons.
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: No blend mode.

Post by rude »

CryNox: love.graphics.setColorMode(love.color_modulate)
User avatar
CryoNox
Prole
Posts: 18
Joined: Sun Jun 28, 2009 2:25 pm
Location: Singapore

Re: No blend mode.

Post 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?
Attachments
LOVE.jpg
LOVE.jpg (34.4 KiB) Viewed 6072 times
Thy father beckons.
User avatar
CryoNox
Prole
Posts: 18
Joined: Sun Jun 28, 2009 2:25 pm
Location: Singapore

Re: No blend mode.

Post 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.
Attachments
game.love
(34.35 KiB) Downloaded 169 times
Thy father beckons.
User avatar
CryoNox
Prole
Posts: 18
Joined: Sun Jun 28, 2009 2:25 pm
Location: Singapore

Re: No blend mode.

Post 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.
Thy father beckons.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 5 guests