StringShape
From Xojo Documentation
This item was deprecated in version 2019r2. Please use TextShape as a replacement. |
Draws a text string in a vector graphics environment.
Properties | ||||||||||||||||
|
Enumerations | |
|
Notes
The X,Y properties specify the center of the string's baseline. Strings that contain line breaks are not supported. StringShapes can be rotated, but doing so is memory intensive, especially for large strings.
Although they will appear in auto-complete and compile, the Border, BorderColor and BorderWidth properties do not do anything with StringShape.
Use the FillColor property to change the color of the text.
Examples
This example draws text rotated 90 degrees. Put it in the Paint event handler of a Canvas:
s.Text = "Hello World"
s.TextFont = "Helvetica"
s.Bold = True
s.Rotation = 3.14159 / 2 // (radians, 90 degrees = pi/2)
s.Y = 100
g.DrawObject(s)
This example aligns the StringShape to the left.
s.X = 20
s.Text = "Hello World"
s.HorizontalAlignment = StringShape.Alignment.Left
g.DrawObject(s)
See Also
ArcShape, CurveShape, FigureShape, FolderItem, Group2D, Graphics, Object2D, OvalShape, Picture, PixmapShape, RectShape, RoundRectShape classes.