Transparancy not working?

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

Transparancy not working?

Post by the underminer »

when I make this new color TitleGreen = Color.new(21,165,69,50)

And then do screen:fillRect(0,0,177,272,TitleGreen)
The underlying image wich I blitted earlier to screen is not visible, while the alpha value is 50. How come? transparancy blitting is available in 0.15, isn't it?
Behold! The Underminer got hold of a PSP
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

It doesnt work in 2.0 either.
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

Post by the underminer »

romero126 wrote:It doesnt work in 2.0 either.
That's just stupid. So there is no version that it works in?
I'll have to use a square image then
Behold! The Underminer got hold of a PSP
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

oh it works it just a 0 - 1, On and off. the % transparency must be in the image itself. Its not done through the luaplayer.
SnowyDisposition
Posts: 4
Joined: Wed Sep 27, 2006 11:41 am

Post by SnowyDisposition »

So you're telling me if I go into Photoshop and create a half-transparent green screen 480x272 and blit it to Lua Player with transparency on, it'll work?

I find this highly unlikely.
Altair
Posts: 76
Joined: Sat May 20, 2006 2:33 am
Location: The Netherlands

Post by Altair »

Hmmm, works for me. If you use this code to fade in and out, it will fade in and out by using transparency and Im on 0.16 (I think).

The code I posted is unaltered and is made by Soulkiller BTW. I tested it in some altered form but it works.

Code: Select all

credits = Image.load("backgrounds/credits.png")
fader = Image.createEmpty(480,272)
alphaValue = 255
faderColor = Color.new(0,0,0,alphaValue)
fader:clear(faderColor)
while true do
screen:clear()
screen:blit(0,0,credits)
screen:blit(0,0,fader)
if alphaValue > 0 then
alphaValue = alphaValue - 5
else
break
end
faderColor = Color.new(0,0,0,alphaValue)
fader:clear(faderColor)
screen.waitVblankStart()
screen.flip()
end
screen.waitVblankStart(300) -- pause so it dosn't fade in and then imdeiatly fade out
while true do
screen:clear()
screen:blit(0,0,credits)
screen:blit(0,0,fader)
if alphaValue < 255 then
alphaValue = alphaValue + 5
else
break
end
faderColor = Color.new&#40;0,0,0,alphaValue&#41;
fader&#58;clear&#40;faderColor&#41;
screen.waitVblankStart&#40;&#41;
screen.flip&#40;&#41;
end
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

SnowyDisposition wrote:So you're telling me if I go into Photoshop and create a half-transparent green screen 480x272 and blit it to Lua Player with transparency on, it'll work?

I find this highly unlikely.
Its exactly what Im saying, PNG files are quite usefull to display transparancy. Full but not partial. Douchebag.
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

Post by the underminer »

[removed]
I posted exactly what romero posted so I removed it
Behold! The Underminer got hold of a PSP
Post Reply