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

2014/1/1

Adding text and updating score

Moynzy Moynzy

2014/1/1

#
Hello, it's me again. Sorry if you guys are getting sick of me. I'm not the best at green foot. I know how to do this on As3 but no on Java. I want to display the text bar. addObject(new Text(), 120, 300); I want the score to update when something happens nScore ++ So the text that has been added to the world will change from Score:1 to Score:2 Thank you.
deathburrito16 deathburrito16

2014/1/2

#
you could in theory create a class for each number, and then program accordingly, but that would be quite time consuming. beyond that, I don't know.
shrucis1 shrucis1

2014/1/2

#
It depends on how you want to display the text, in an object, or drawn on the background. If you have a background image that tiles, it's probably better to use an object, but normally I draw it onto the background.
shrucis1 shrucis1

2014/1/2

#
Sorry, deathburrito16, didn't see your post, Simultaneous Posting! :D (Anddd... Greenfoot website crashes) But no, you don't need a class for each number, as you can draw text directly onto an image.
Moynzy Moynzy

2014/1/2

#
You see, my assignment says I can't draw on the background, make changed to the world, the pitch. A class for each number seems very ferocious, ++ would be more efficient right? I want to display the text in an object, but on Green foot I can't find any actor classes that support text. That's my issues.
deathburrito16 deathburrito16

2014/1/2

#
you probably already did this, but I'd loo at tutorial #6, here. It might help.
deathburrito16 deathburrito16

2014/1/2

#
look. lol! \
Moynzy Moynzy

2014/1/2

#
Thank you, I'm looking and trying to understand lol
You need to login to post a reply.