Original Description:
TextOnScreen allows drawing text on screen inside a 3D Sprite. To use it, first copy "cTextOnScreen" and "cTextToTexture" classes in your movie. Then create a new instance of "cTextOnScreen" passing a 3D sprite and a text member as parameters:
textOnScreen = script("cTextOnScreen").new(member("world"), member("text"))
Then to add text:
textOnScreen.write("some text") -- adds "some text" at the end of the line
textOnScreen.writeln("some other text") -- adds "some other text" and add a carriage return
To update the text on screen, use:
textOnScreen.update()
"cTextOnScreen" has also some additional functions in order to set a transparent background or not:
textOnScreen.transparentBackground(FALSE) -- TRUE by default
to change the background colour:
textOnScreen.setBackgroundColor(rgb(255,0,0)) -- for a red background
to change the text position:
textOnScreen.setPosition(point(10,10)) -- moves the text to the position (10,10)
to change the text scale:
textOnScreen.setScale(2) -- doubles the text size
and some other less important functions (please see the source code for more details!).