ModifyText3D sprite,x#,y#,text$[,flags]

Parameters

sprite - handle to existing sprite
x - horizontal screen coordinate (in pixels)
y - vertical screen coordinate (in pixels)
text$ - text string to display in sprite

flags (optional):
1: Color *
2: Alpha
4: Masked *
8: Mipmapped
16: Clamp U
32: Clamp V
64: Spherical reflection map
128: <void>
256: Store texture in vram
512: Force the use of high color textures

* Default

Description

Modifys an existing sprite created with Text3D() to display a new text message.
The foreground and background colours are set with Color and ClsColor commands. Font and size are set using the SetFont command.

If no text is supplied a default '?' will be used.
To use this command, first create a text sprite with the Text3D() function.

Example Code:

textsprite=Text3D(100,50,"My new text message")
ModifyText3D textsprite,100,50,"Message changed"

The x,y,text$ parameters are the same as used in Text3D()

* NOTE: It is important to initialise the sprite display system first!
See SpriteGraphics3D or CreateSpritePivot()

See Also: FreeImage3D

Thanks go to EricZann for suggesting this command.

Example

Include "Sprite Control.bb"

SpriteGraphics3D 640,480

SetFont LoadFont("Tahoma",38,True) ; size 38 and bold

sprite=Text3D(320,240,"Hello World!")
RenderWorld
Text 10,10,"Press SPACE to change message .."
Flip : WaitKey

ModifyText3D sprite,320,240,"Thats all!"
RenderWorld
Text 10,10,"Done. Press a key to end program .."
Flip : WaitKey

End


Index