v.0.4.0 tryout.emojis
This commit is contained in:
@@ -43,8 +43,9 @@ class NeoPixel_64x64(NeoPixel):
|
||||
self.selected_font = font
|
||||
|
||||
# Höhe des Fonts, Anzahl der Zeilen für jedes Zeichen
|
||||
# wir holen den Wert aus "A"
|
||||
self.font_height = len(self.selected_font['A'])
|
||||
# wir holen den ersten Wert des Fonts
|
||||
first_char = next(iter(self.selected_font))
|
||||
self.font_height = len(self.selected_font[first_char])
|
||||
print(f'Font set: width: per char; height: {self.font_height}')
|
||||
|
||||
def set_pixel(self, x, y, color):
|
||||
@@ -110,9 +111,7 @@ class NeoPixel_64x64(NeoPixel):
|
||||
[
|
||||
# print(xpos, ypos)
|
||||
self.set_pixel(xpos, ypos, GRAY)
|
||||
for xpos in range(
|
||||
x, x + char_width
|
||||
) # 8 because full with of character representation
|
||||
for xpos in range(x, x + char_width) # 8 because full with of character representation
|
||||
for ypos in range(y, y + self.font_height)
|
||||
]
|
||||
|
||||
@@ -157,9 +156,7 @@ class NeoPixel_64x64(NeoPixel):
|
||||
|
||||
self.write()
|
||||
|
||||
def vertical_floating_text(
|
||||
self, text, x, color=RAINBOW[0], float_range=3, speed=0.2, duration=10
|
||||
):
|
||||
def vertical_floating_text(self, text, x, color=RAINBOW[0], float_range=3, speed=0.2, duration=10):
|
||||
"""
|
||||
Vertical floating text animation
|
||||
|
||||
@@ -190,9 +187,7 @@ class NeoPixel_64x64(NeoPixel):
|
||||
self.write()
|
||||
time.sleep(0.05)
|
||||
|
||||
def horizontal_floating_text(
|
||||
self, text, y, color=RAINBOW[0], float_range=3, speed=0.2, duration=10
|
||||
):
|
||||
def horizontal_floating_text(self, text, y, color=RAINBOW[0], float_range=3, speed=0.2, duration=10):
|
||||
"""
|
||||
Horizontal floating text animation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user