Android Question [Resolved]Libgdx Sprite Transparency

walterf25

Expert
Licensed User
Longtime User
Hi all ,
I m new to b4a but im very excited about this great develepment enviroment.
So i started experimanting with Libgdx and i m creating a multiplayer game but i want the other players to
be transparent and i cant find an way to do that with sprite batch .
So any ideas are Wellcome thanks Alot !!
I think you might be able to change the alpha parameter, haven't tried it but it should work.

Cheers,
Walter
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
hmmm i cant seem to set the alpha proprty correctly ,
so lets say i want to set to 50 % transprence
i tryed Batch.Color.alpha(0.5) before my
Batch.DrawRegion3
but nothing happend ...
I know its a little silly question but , as i said im a beginer in b4a :)
1) I suggested to change the alpha value of Smiley.Color, not the one of Batch.Color. It's easy to do in the demo because you just have to change the last parameter of Smiley.Color.SetRGBA (line #118).
2) The Alpha function is not documented and you've been fooled by the function name. In fact, it converts a float value between 0 and 1 to an int value between 0 and 255. Use setRGBA, as in the demo, to change the alpha value.
 
Upvote 0
Top