Exposed more parameters
More parameters for text entries
This commit is contained in:
parent
dcbed64aa9
commit
a73014aeb6
@ -25,7 +25,7 @@ class OledData:
|
|||||||
self.data = entries
|
self.data = entries
|
||||||
|
|
||||||
@staticmethod
|
@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 {
|
return {
|
||||||
0: text,
|
0: text,
|
||||||
1: x,
|
1: x,
|
||||||
@ -34,6 +34,9 @@ class OledData:
|
|||||||
4: OledEntryType.TXT,
|
4: OledEntryType.TXT,
|
||||||
5: x_anchor,
|
5: x_anchor,
|
||||||
6: y_anchor,
|
6: y_anchor,
|
||||||
|
7: direction,
|
||||||
|
8: line_spacing,
|
||||||
|
9: inverted,
|
||||||
}
|
}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -87,9 +90,13 @@ class Oled(Extension):
|
|||||||
label.Label(
|
label.Label(
|
||||||
terminalio.FONT,
|
terminalio.FONT,
|
||||||
text=view[0],
|
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]),
|
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:
|
elif view[4] == OledEntryType.IMG:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user