Alpha Blending?
Alpha Blending?
I'm new to Love2D; but not to programming. I want to know if I can have more control over alpha blending. It doesn't matter to much to me because I can probably produce the effect I am looking for without full control. All I found was BlendMode.
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Alpha Blending?
You can set the alpha of anything by using love.graphics.setColor(r,g,b,a). Also, Love fully supports .png images with alpha.
Also, welcome to the framework and the community.
Also, welcome to the framework and the community.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Re: Alpha Blending?
Thanks, Taehl. I'm afraid that I didn't make myself clear. I will probably extend love when I need to implement lighting.
I'm thinking that I'll implement it like:
Lua
DirectX (I know Love uses OpenGL)
Here: love.graphics.setBlendFunc.
I'm thinking that I'll implement it like:
Lua
Code: Select all
love.graphics.setBlendState('func', 'always')
love.graphics.setBlendState('src', 'zero')
love.graphics.setBlendState('dst', 'srcAlpha')
Code: Select all
Device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
Device->SetRenderState(D3DRS_SRCBLENDALPHA, D3DBLEND_ZERO);
Device->SetRenderState(D3DRS_DESTBLENDALPHA, D3DBLEND_SRCALPHA);
Device->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_ALWAYS);
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest