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

2012/11/10

How can I make a Textbox correctly?

1
2
danpost danpost

2012/11/10

#
Also, with that change, use
setValue(pacman.score);
Yellowfoot Yellowfoot

2012/11/10

#
I tried this:
cPacman pacman = (cPacman) getObjects(cPacman.class).get(0); 
        setValue(pacman.score);
Error: cannot find symbol - method getObjects(java.lang.Class<cPacman>) Maybe i have to import something? Just have this:
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
regards
danpost danpost

2012/11/10

#
Is this code NOT in the world class?
Yellowfoot Yellowfoot

2012/11/10

#
No its in the Counter class! Counter is a Subclass of Actor. regards
danpost danpost

2012/11/10

#
Oh, NVM. It is in an actor class How about:
cPacman pacman = (cPacman) getWorld().getObjects(cPacman.class).get(0); 
setValue(pacman.score);
Yellowfoot Yellowfoot

2012/11/10

#
Works, finally :) Thank you very much. :)
You need to login to post a reply.
1
2