acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

lv_example_anim_2.py (949B)

      1 def anim_x_cb(obj, v):
      2     obj.set_x(v)
      3 
      4 def anim_size_cb(obj, v):
      5     obj.set_size(v, v)
      6 
      7 
      8 #
      9 # Create a playback animation
     10 #
     11 obj = lv.obj(lv.scr_act())
     12 obj.set_style_bg_color(lv.palette_main(lv.PALETTE.RED), 0)
     13 obj.set_style_radius(lv.RADIUS.CIRCLE, 0)
     14 
     15 obj.align(lv.ALIGN.LEFT_MID, 10, 0)
     16 
     17 a1 = lv.anim_t()
     18 a1.init()
     19 a1.set_var(obj)
     20 a1.set_values(10, 50)
     21 a1.set_time(1000)
     22 a1.set_playback_delay(100)
     23 a1.set_playback_time(300)
     24 a1.set_repeat_delay(500)
     25 a1.set_repeat_count(lv.ANIM_REPEAT.INFINITE)
     26 a1.set_path_cb(lv.anim_t.path_ease_in_out)
     27 a1.set_custom_exec_cb(lambda a1,val: anim_size_cb(obj,val))
     28 lv.anim_t.start(a1)
     29 
     30 a2 = lv.anim_t()
     31 a2.init()
     32 a2.set_var(obj)
     33 a2.set_values(10, 240)
     34 a2.set_time(1000)
     35 a2.set_playback_delay(100)
     36 a2.set_playback_time(300)
     37 a2.set_repeat_delay(500)
     38 a2.set_repeat_count(lv.ANIM_REPEAT.INFINITE)
     39 a2.set_path_cb(lv.anim_t.path_ease_in_out)
     40 a2.set_custom_exec_cb(lambda a1,val: anim_x_cb(obj,val))
     41 lv.anim_t.start(a2)