Skip to content

Commit

Permalink
updated readme and example
Browse files Browse the repository at this point in the history
  • Loading branch information
pabletos committed Oct 7, 2024
1 parent 0454eaf commit 1c32428
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ pizzoo.render_template('''
''')
```

Template rendering provide a lot of options, including self-updating time, date, weather...(Using tags like <date>, <time> and so on) and even support for using images or gifs as backgrounds (check the examples).

<p align="center">
<img width="320" height="320" src="https://raw.githubusercontent.com/pabletos/pizzoo/main/docs/docs/assets/images/qs-6.png">
</p>
Expand Down
23 changes: 21 additions & 2 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,24 @@ def example_template():
</pizzoo>
''')

def example_template_bg():
'''
Render an XML template on the Pixoo device with a background gif.
'''
pizzoo.render_template('''
<pizzoo background="./files/test_gif.gif">
<rectangle x="0" y="0" width="64" height="8" color="0">
<section x="0" y="1">
<date format="DD" x="1" color="#ffc107" font="small"></date>
<text x="9" color="#ffc107">-</text>
<date format="MM" x="13" color="#ffc107" font="small"></date>
<time format="HH:mm" x="26" font="small"></time>
<date format="WWW" width="63" x="50" color="#ffc107" font="small"></date>
</section>
</rectangle>
</pizzoo>
''')

def example_advanced_animation():
'''
Advanced animation example for creating complex animations adding frames to the buffer.
Expand Down Expand Up @@ -150,8 +168,9 @@ def example_game():
'7': {'Buzzer': example_buzzer},
'8': {'Countdown': example_countdown},
'9': {'Render an XML template': example_template},
'10': {'Advanced Animation': example_advanced_animation},
'11': {'Game': example_game}
'10': {'Render a template with a gif background': example_template_bg},
'11': {'Advanced Animation': example_advanced_animation},
'12': {'Game': example_game}
}
print('Select an example to run:')
for key, value in menu.items():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/
setup(
name="pizzoo",
version="0.9.11",
version="0.9.12",
author="Pablo Huet",
description="Pizzoo is a easy-to-use library for rendering on pixel matrix screens like the Pixoo64, featuring easy new device integration, animation tools, and XML template rendering support.",
long_description=long_description,
Expand Down

0 comments on commit 1c32428

Please sign in to comment.