Skip to content

Commit c7e668e

Browse files
authored
Merge pull request #562 from jedgarpark/pyportal-text-positions
adjusted text and bg image
2 parents 96dc623 + 82145be commit c7e668e

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

PyPortal_AirQuality/airquality.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
status_neopixel=board.NEOPIXEL,
3434
default_bg=0x000000,
3535
text_font=cwd+"/fonts/Helvetica-Bold-100.bdf",
36-
text_position=(90, 0),
36+
text_position=(100, 110),
3737
text_color=0x000000,
3838
caption_text="Air Quality Index for "+LOCATION,
3939
caption_font=cwd+"/fonts/HelveticaNeue-24.bdf",
40-
caption_position=(15, 200),
40+
caption_position=(15, 220),
4141
caption_color=0x000000,)
4242

4343
while True:

PyPortal_OpenWeather/openweather_graphics.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
import board
44
import displayio
5-
from adafruit_display_text.text_area import TextArea
5+
from adafruit_display_text.label import Label
66
from adafruit_bitmap_font import bitmap_font
77

88
cwd = ("/"+__file__).rsplit('/', 1)[0] # the current working directory (where this file is)
@@ -37,27 +37,27 @@ def __init__(self, root_group, *, am_pm=True, celsius=True):
3737
self.large_font.load_glyphs(('°',)) # a non-ascii character we need for sure
3838
self.city_text = None
3939

40-
self.time_text = TextArea(self.medium_font, width=8)
40+
self.time_text = Label(self.medium_font, max_glyphs=8)
4141
self.time_text.x = 200
42-
self.time_text.y = 0
42+
self.time_text.y = 12
4343
self.time_text.color = 0xFFFFFF
4444
self._text_group.append(self.time_text)
4545

46-
self.temp_text = TextArea(self.large_font, width=6)
46+
self.temp_text = Label(self.large_font, max_glyphs=6)
4747
self.temp_text.x = 200
48-
self.temp_text.y = 155
48+
self.temp_text.y = 195
4949
self.temp_text.color = 0xFFFFFF
5050
self._text_group.append(self.temp_text)
5151

52-
self.main_text = TextArea(self.large_font, width=20)
52+
self.main_text = Label(self.large_font, max_glyphs=20)
5353
self.main_text.x = 10
54-
self.main_text.y = 155
54+
self.main_text.y = 195
5555
self.main_text.color = 0xFFFFFF
5656
self._text_group.append(self.main_text)
5757

58-
self.description_text = TextArea(self.small_font, width=60)
58+
self.description_text = Label(self.small_font, max_glyphs=60)
5959
self.description_text.x = 10
60-
self.description_text.y = 205
60+
self.description_text.y = 225
6161
self.description_text.color = 0xFFFFFF
6262
self._text_group.append(self.description_text)
6363

@@ -71,9 +71,9 @@ def display_weather(self, weather):
7171
city_name = weather['name'] + ", " + weather['sys']['country']
7272
print(city_name)
7373
if not self.city_text:
74-
self.city_text = TextArea(self.medium_font, text=city_name)
74+
self.city_text = Label(self.medium_font, text=city_name)
7575
self.city_text.x = 10
76-
self.city_text.y = 0
76+
self.city_text.y = 12
7777
self.city_text.color = 0xFFFFFF
7878
self._text_group.append(self.city_text)
7979

PyPortal_Youtube/youtube.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
status_neopixel=board.NEOPIXEL,
3434
default_bg=cwd+"/youtube_background.bmp",
3535
text_font=cwd+"/fonts/Collegiate-50.bdf",
36-
text_position=((100, 85), (180, 130)),
36+
text_position=((100, 85+44), (155, 140+40)),
3737
text_color=(0xFFFFFF, 0xFFFFFF),
3838
caption_text=CAPTION,
3939
caption_font=cwd+"/fonts/Collegiate-24.bdf",
40-
caption_position=(40, 200),
40+
caption_position=(40, 200+20),
4141
caption_color=0xFFFFFF)
4242

4343
# track the last value so we can play a sound when it updates
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)