Draws a text object
The size is fixed, and does not scale with the drawing.
The hit-test is done on the entire text extent
wx.lib.floatcanvas.FCObjects.DrawObject
, wx.lib.floatcanvas.FCObjects.TextObjectMixin
Default class constructor. |
Text
(TextObjectMixin, DrawObject)¶Draws a text object
The size is fixed, and does not scale with the drawing.
The hit-test is done on the entire text extent
__init__
(self, String, xy, Size = 14, Color = "Black", BackgroundColor = None, Family = wx.FONTFAMILY_MODERN, Style = wx.FONTSTYLE_NORMAL, Weight = wx.FONTWEIGHT_NORMAL, Underlined = False, Position = 'tl', InForeground = False, Font = None)¶Default class constructor.
string (string) – the text to draw
XY – the (x, y) coordinate of the corner of the text, or a 2-tuple, or a (2,) NumPy array
Size – the font size
Color – see SetColor
BackgroundColor – see SetColor
Family (FontFamily) – a valid wx.FontFamily
Style (FontStyle) – a valid wx.FontStyle
Weight (FontWeight) – a valid wx.FontWeight
Underlined (boolean) – underline the text
Position (string) – a two character string indicating where in relation to the coordinates the box should be oriented
InForeground (boolean) – should object be in foreground
Font (wx.Font) –
alternatively you can define wx.Font and the above will be ignored.
1st character |
Meaning |
---|---|
|
top |
|
center |
|
bottom |
2nd character |
Meaning |
---|---|
|
left |
|
center |
|
right |
Font – a valid wx.Font
InForeground – should object be in foreground