1# 2# Create a fake text shadow 3# 4 5# Create a style for the shadow 6style_shadow = lv.style_t() 7style_shadow.init() 8style_shadow.set_text_opa(lv.OPA._30) 9style_shadow.set_text_color(lv.color_black()) 10 11# Create a label for the shadow first (it's in the background) 12shadow_label = lv.label(lv.scr_act()) 13shadow_label.add_style(style_shadow, 0) 14 15# Create the main label 16main_label = lv.label(lv.scr_act()) 17main_label.set_text("A simple method to create\n" 18 "shadows on a text.\n" 19 "It even works with\n\n" 20 "newlines and spaces.") 21 22# Set the same text for the shadow label 23shadow_label.set_text(lv.label.get_text(main_label)) 24 25# Position the main label 26main_label.align(lv.ALIGN.CENTER, 0, 0) 27 28# Shift the second label down and to the right by 2 pixel 29shadow_label.align_to(main_label, lv.ALIGN.TOP_LEFT, 2, 2) 30 31