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

2014/1/3

Removing the background colour for a string

xChaoswar xChaoswar

2014/1/3

#
I'm having trouble removing the background colour of a string. this is what I have:
public DCCost() 
    {  
        setImage(new GreenfootImage("Upgrade: " + cost, 20, Color.BLUE, null));
    }    
    public void setCost(int cost)
    {
        setImage(new GreenfootImage("Upgrade: " + cost, 20, Color.BLUE, null));
    } 
but when I have null, i would have assumed it'd be transparent - instead it returns as white. No idea what to do.
bourne bourne

2014/1/3

#
You could always try full transparency: new Color(0, 0, 0, 0)
xChaoswar xChaoswar

2014/1/3

#
No idea how to implement that :s
You need to login to post a reply.