This site requires JavaScript, please enable it in your browser!
Greenfoot back
Sathya_srikanth
Sathya_srikanth wrote ...

2021/1/6

transparency

Sathya_srikanth Sathya_srikanth

2021/1/6

#
i need to reduce the transparency of an object every time it touches the other, say by 10
danpost danpost

2021/1/6

#
Sathya_srikanth wrote...
i need to reduce the transparency of an object every time it touches the other, say by 10
The GreenfootImage class has a setTransparency method you can use. You will need to track the currently set transparency value with an int field so you can first retain its current value and second limit any new value to the range (0, 255).
You need to login to post a reply.