2022-10-21 22:59:05 +08:00
|
|
|
#!pika
|
2022-06-15 12:31:31 +00:00
|
|
|
import pika_lvgl as lv
|
|
|
|
import PikaStdLib
|
|
|
|
mem = PikaStdLib.MemChecker()
|
|
|
|
|
|
|
|
label1 = lv.label(lv.scr_act())
|
|
|
|
LV_LABEL_LONG_WRAP = 0
|
|
|
|
label1.set_long_mode(LV_LABEL_LONG_WRAP) # Break the long lines*/
|
|
|
|
# Enable re-coloring by commands in the text
|
|
|
|
label1.set_recolor(True)
|
|
|
|
label1.set_text("#0000ff Re-color# #ff00ff words# #ff0000 of a# label, \
|
|
|
|
align the lines to the center and wrap long text automatically.")
|
|
|
|
# Set smaller width to make the lines wrap
|
|
|
|
label1.set_width(150)
|
|
|
|
label1.set_style_text_align(lv.ALIGN.CENTER, 0)
|
|
|
|
label1.align(lv.ALIGN.CENTER, 0, -40)
|
|
|
|
|
|
|
|
LV_LABEL_LONG_SCROLL_CIRCULAR = 3
|
|
|
|
label2 = lv.label(lv.scr_act())
|
|
|
|
label2.set_long_mode(LV_LABEL_LONG_SCROLL_CIRCULAR) # Circular scroll
|
|
|
|
label2.set_width(150)
|
|
|
|
label2.set_text("It is a circularly scrolling text. ")
|
|
|
|
label2.align(lv.ALIGN.CENTER, 0, 40)
|
|
|
|
|
|
|
|
print('mem used max: %0.2f kB' % (mem.getMax()))
|
|
|
|
print('mem used now: %0.2f kB' % (mem.getNow()))
|
2022-10-21 22:59:05 +08:00
|
|
|
#!pika
|