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

2014/8/9

Using the new showText() method

edparrish edparrish

2014/8/9

#
Is there a way to set the font or color with the new showText() method introduced in Greenfoot 2.4? I looked in the API documentation but did not see a way. I also tried making font changes to the background image but did not see any effect on the font of the showText() method.
danpost danpost

2014/8/10

#
I do not think that adding the 'showText' method to the World class API was a very wise idea -- especially since no support was provided for it. @edparrish, I would like for you to post results from the following tests with the 'showText' method: Report how a text is displayed on a white background as well as a black background. Data requested are background color and text color for both backgrounds and the approximate font size in pixels (you could place known sized text next to it for comparison).
edparrish edparrish

2014/8/10

#
Hi danpost, The text always shows as white with a black outline independent of the background color in a fairly large font of about 24 pixels. It is actually not very readable on my screen.
danpost danpost

2014/8/10

#
edparrish wrote...
Hi danpost, The text always shows as white with a black outline independent of the background color in a fairly large font of about 24 pixels. It is actually not very readable on my screen.
Actually, 24 font size should be easy to read (at least above the average for reading text). The word 'outline' is not very clear to me. Are you saying that the resultant image is a black rectangle with white text on it? So, when using a black background, only the text is apparent (until an actor or something intersects it); while when using a white one, the black background color of the text is apparent as well? That would mean the entire text image is opaque and since it is painted over top of all other actors, the text images would completely hide what might be going on behind them.
edparrish edparrish

2014/8/11

#
Hi danpost, You would think that 24 font size would be readable, but the font is a blocky one that has a black line outlining each character. The inside of the character is white. Some of the letters like "e" are hard to read. Here is an image on a red background: . Notice how the bar across the "e" is all black. Imagine that on a black background.
danpost wrote...
That would mean the entire text image is opaque and since it is painted over top of all other actors, the text images would completely hide what might be going on behind them.
Yes, that is true.
edparrish edparrish

2014/8/11

#
Well I guess the image link was not successful. Here is a link to the image: Test image
edparrish edparrish

2014/8/11

#
Well I guess my anti-leach protection is kicking in. Try this link.Test image
danpost danpost

2014/8/13

#
I created a subclass to GreenfootImage that will resolve your issue. Check this out.
You need to login to post a reply.