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

2016/10/7

Text box problems.

Samas Samas

2016/10/7

#
Hi all, I am working on a game and I want to change the font of the text and to have the text display on an image. Also I was wondering how I would use a different font than the ones built into green foot thanks in advance.
danpost danpost

2016/10/7

#
My TextImage Support Class sounds like the ticket for you. Add the TextImage class to your scenario and instead of creating a GreenfootImage object directly, you can create a TextImage object (still a GreenfootImage object, but more specialized) to set to the actor that is to display the text. The TextImage Support Class scenario shows how to create text with different styles, fonts, sizes, etc. (as well as getting all the available fonts from your environment).
Samas Samas

2016/10/7

#
the code threw some null pointer exceptions my way so I dont know what the code actually does. Any way you can briefly explain how to use the TextImage class?
danpost danpost

2016/10/7

#
It is just a "glorified" GreenfootImage class for text. It has constructors and methods to deal with pretty much anything dealing with text. View the class in "Documentation" mode to view it as API documentation. It explains how to use the class. If you are getting errors or exceptions, you should show the code in question along with the message (otherwise, it would be quite difficult to help).
You need to login to post a reply.