You might even wanna take a look at my ui project including a text class that is specificity designed for that:
https://www.greenfoot.org/scenarios/26443
Your right - setTransparency(int) changes the transparency of the whole image. If you want to create images by hand or from a downloaded one and make some parts transparent, simply try for example Paint3D. Basically any image editor I can think of, except Paint. Just make sure to export it as .png
You can do that in Greenfoot using image.setTransparency(0-255) where image is an instance of GreenfootImage or for colors new Color(redValue, greenValue, blueValue, transparency)
Using for example:
public String getName() {
UserInfo user = Greenfoot.getUserInfo();
if(user == null) return "Greenfoot User";
return user.getUserName();
}
@DatHeroAndy When you simply draw the shapes onto the painting and the color is somewhat transparent, the color gets darker the longer you hold onto the same place, and that quicker, if the framerate is higher. Also, you can see the steps of the single frames drawing for example a circle because where two half-transparent shapes overlay, they will be darker.
To encounter this problem, you first draw onto a different image that is shown above, with full density, but the image is transparent. When you stop drawing, the overlaying image with the changes gets copied onto the real image, pixel by pixel. This lags.
2020/10/28
World of Tanks 2d
2020/10/28
GBox2D
2020/10/26
World of Tanks 2d
2020/10/26
World of Tanks 2d
2020/10/26
World of Tanks 2d
2020/10/15
Windows XP: Greenfoot Edition
2020/10/15
Windows XP: Greenfoot Edition
2020/10/15
Paint 2D
2020/10/15
Paint 2D