screen:fillRect() does not work with alpha value on v0.16

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

Moderators: Shine, Insert_witty_name

Post Reply
Mrdjack
Posts: 2
Joined: Mon Feb 27, 2006 2:11 am

screen:fillRect() does not work with alpha value on v0.16

Post by Mrdjack »

i use lua player v0.16 with 1.5 PSP firmware.

when i do a screen:fillRect(0, 0, 100, 100, Color.new(0, 255, 0, 128)), the screen is fill with a green, but the alpha value isn't correct (full alpha).

but when i do a fillRect with half alpha on an image, and i blit to screen, here the result is good.

why screen:fillRect() with non full alpha doesn't work ?

thank for your help and sorry for my english.

++
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

Alpha is used in a 0-1 ... so
if you want it half alpha use 0.5 as the paramater.

Otherwise anything over 1. is fully Visible and 0 is invisible.
Mrdjack
Posts: 2
Joined: Mon Feb 27, 2006 2:11 am

Post by Mrdjack »

thank for your help romero126
++
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Re: screen:fillRect() does not work with alpha value on v0.1

Post by Shine »

Mrdjack wrote:why screen:fillRect() with non full alpha doesn't work ?
The screen doesn't support alpha, only images, because Lua Player uses only the source for alpha blitting. And alpha values are integers from 0 to 255. But you can use the 3D functions for setting the alpha blitting mode yourself.
Post Reply