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

2017/2/1

Question about the World's showText() method

nelutux nelutux

2017/2/1

#
is there any way to hide the showText() method after a few seconds?
Super_Hippo Super_Hippo

2017/2/1

#
I don't think there is a method to just remove one of those texts somehow. Even if you set a new background, the text stays there. However, you can use the showText method again on the same position with an empty String to remove the previous one.
1
showText("", 100, 100);
davmac davmac

2017/2/1

#
I guess you mean you want the text shown to disappear after a few seconds. Did you try reading the documentation? :)
Show some text centred at the given position in the world. The text will be displayed in front of any actors. Any previous text shown at the same location will first be removed. Parameters: text - The text to display; can be null to show no text x - X-coordinate of the text y - Y-coordinate of the text
So: after a few seconds, call showText again with the same co-ordinates but null for the text (or the empty string as suggested above).
You need to login to post a reply.