Exposed more parameters

More parameters for text entries
This commit is contained in:
regicidal.plutophage 2023-02-27 18:27:43 +03:00 committed by GitHub
parent dcbed64aa9
commit a73014aeb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,7 @@ class OledData:
self.data = entries
@staticmethod
def oled_text_entry(x=0, y=0, x_anchor=0.0, y_anchor=0.0, text='', layer=None):
def oled_text_entry(text='', x=0, y=0, x_anchor=0.0, y_anchor=0.0, direction='LTR', line_spacing=0.75, inverted=False, layer=None):
return {
0: text,
1: x,
@ -34,6 +34,9 @@ class OledData:
4: OledEntryType.TXT,
5: x_anchor,
6: y_anchor,
7: direction,
8: line_spacing,
9: inverted,
}
@staticmethod
@ -87,9 +90,13 @@ class Oled(Extension):
label.Label(
terminalio.FONT,
text=view[0],
color=0xFFFFFF,
color=0xFFFFFF if view[9] == False else 0x000000,
background_color=0x000000 if view[9] == False else 0xFFFFFF,
anchor_point=(view[5],view[6]),
anchored_position = (view[1],view[2]),
anchored_position=(view[1],view[2]),
label_direction=view[7],
line_spacing=view[8],
padding_left=1,
)
)
elif view[4] == OledEntryType.IMG: