@@ -145,13 +145,45 @@ def chunks(lst, n):
145
145
146
146
147
147
class LabelBase (Group ):
148
+ """Super class that all other types of labels will extend. This contains
149
+ all of the properties and functions that work the same way in all labels.
150
+
151
+ subclasses should implement _set_text, _set_font, and _set_line_spacing to
152
+ have the correct behavior fo rthat type of label.
153
+
154
+ :param Font font: A font class that has ``get_bounding_box`` and ``get_glyph``.
155
+ Must include a capital M for measuring character size.
156
+ :param str text: Text to display
157
+ :param int max_glyphs: Unnecessary parameter (provided only for direct compability
158
+ with label.py)
159
+ :param int color: Color of all text in RGB hex
160
+ :param int background_color: Color of the background, use `None` for transparent
161
+ :param double line_spacing: Line spacing of text to display
162
+ :param boolean background_tight: Set `True` only if you want background box to tightly
163
+ surround text. When set to 'True' Padding parameters will be ignored.
164
+ :param int padding_top: Additional pixels added to background bounding box at top
165
+ :param int padding_bottom: Additional pixels added to background bounding box at bottom
166
+ :param int padding_left: Additional pixels added to background bounding box at left
167
+ :param int padding_right: Additional pixels added to background bounding box at right
168
+ :param (float,float) anchor_point: Point that anchored_position moves relative to.
169
+ Tuple with decimal percentage of width and height.
170
+ (E.g. (0,0) is top left, (1.0, 0.5): is middle right.)
171
+ :param (int,int) anchored_position: Position relative to the anchor_point. Tuple
172
+ containing x,y pixel coordinates.
173
+ :param int scale: Integer value of the pixel scaling
174
+ :param bool save_text: Set True to save the text string as a constant in the
175
+ label structure. Set False to reduce memory use.
176
+ :param: bool base_alignment: when True allows to align text label to the baseline.
177
+ This is helpful when two or more labels need to be aligned to the same baseline"""
178
+
179
+ # pylint: disable=unused-argument, too-many-instance-attributes, too-many-locals, too-many-arguments
148
180
def __init__ (
149
181
self ,
150
182
font ,
151
183
x = 0 ,
152
184
y = 0 ,
153
185
text = "" ,
154
- max_glyphs = None , # This input parameter is ignored, only present for compatibility
186
+ max_glyphs = None ,
155
187
# with label.py
156
188
color = 0xFFFFFF ,
157
189
background_color = None ,
@@ -296,7 +328,7 @@ def scale(self, new_scale):
296
328
self .local_group .scale = new_scale
297
329
self .anchored_position = self ._anchored_position # update the anchored_position
298
330
299
- def _set_text (self , text , scale ):
331
+ def _set_text (self , new_text , scale ):
300
332
# subclasses should override this
301
333
pass
302
334
0 commit comments