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

2015/3/2

setImage doesn't work

2leftfeet 2leftfeet

2015/3/2

#
working w/the tut-access-p1 tutorial the counter doesn't change score. it's the setImage tag. what prevents the updated image from displaying
public void bumpCount(int amount)
    {
        totalCount += amount;
        setImage(new GreenfootImage("" + totalCount, 30, Color.WHITE, Color.BLACK));
    }
danpost danpost

2015/3/2

#
Maybe the counter being changed is not the one in the world. Make sure you have only one occurrence of 'new Counter' in your World subclass and that it is assigned to the field declared to hold it.
2leftfeet 2leftfeet

2015/3/3

#
dan the man. i had a 2nd occurrence in the world like you said. fixed!
You need to login to post a reply.