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

2017/1/7

Image changing problems

wolfyze wolfyze

2017/1/7

#
I've been trying to add Quests to my game. Now, I want it to change the text when you click on the quest, but it doesn't seem to work well.
 protected void addedToWorld(World myWorld){
         Color Transparent=new Color(0,0,0,0);
           setImage(new GreenfootImage("! Pesky Mushrooms",15,Color.GREEN,Transparent));
        }
    public void act() 
    {
       Color Transparent=new Color(0,0,0,0);
       
       
           if(Greenfoot.mouseClicked(this)){
       setImage(new GreenfootImage("QUEST\n Hey, you! Could you kill 5 mushrooms for me?\n They're really annoying. Just go east. \n Y/N",15,Color.BLACK,Color.BLUE));
      
        }
        
    }    
before I click after I click It doesn't really look pretty, as you can see. Help would be appreciated, thx.
danpost danpost

2017/1/7

#
Apparently, you have more than one of these text actors in the world. You can test this by dragging it while the scenario is stopped. First, try before running the scenario; then, again, after starting and pausing it. Report back results and post your World subclass code for fixing.
wolfyze wolfyze

2017/1/8

#
Oh, it works now. I forgot to make the quest window add only one text ;_; Thank you
You need to login to post a reply.