first commit
This commit is contained in:
commit
e6a42e28e9
4355 changed files with 4626605 additions and 0 deletions
30
libraries/lvgl/examples/widgets/label/lv_example_label_2.py
Normal file
30
libraries/lvgl/examples/widgets/label/lv_example_label_2.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#
|
||||
# Create a fake text shadow
|
||||
#
|
||||
|
||||
# Create a style for the shadow
|
||||
style_shadow = lv.style_t()
|
||||
style_shadow.init()
|
||||
style_shadow.set_text_opa(lv.OPA._30)
|
||||
style_shadow.set_text_color(lv.color_black())
|
||||
|
||||
# Create a label for the shadow first (it's in the background)
|
||||
shadow_label = lv.label(lv.scr_act())
|
||||
shadow_label.add_style(style_shadow, 0)
|
||||
|
||||
# Create the main label
|
||||
main_label = lv.label(lv.scr_act())
|
||||
main_label.set_text("A simple method to create\n"
|
||||
"shadows on a text.\n"
|
||||
"It even works with\n\n"
|
||||
"newlines and spaces.")
|
||||
|
||||
# Set the same text for the shadow label
|
||||
shadow_label.set_text(lv.label.get_text(main_label))
|
||||
|
||||
# Position the main label
|
||||
main_label.align(lv.ALIGN.CENTER, 0, 0)
|
||||
|
||||
# Shift the second label down and to the right by 2 pixel
|
||||
shadow_label.align_to(main_label, lv.ALIGN.TOP_LEFT, 2, 2)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue