@@ -1,14 +0,0 @@
|
||||
obj1 = lv.obj(lv.screen_active())
|
||||
obj1.set_size(100, 50)
|
||||
obj1.align(lv.ALIGN.CENTER, -60, -30)
|
||||
|
||||
style_shadow = lv.style_t()
|
||||
style_shadow.init()
|
||||
style_shadow.set_shadow_width(10)
|
||||
style_shadow.set_shadow_spread(5)
|
||||
style_shadow.set_shadow_color(lv.palette_main(lv.PALETTE.BLUE))
|
||||
|
||||
obj2 = lv.obj(lv.screen_active())
|
||||
obj2.add_style(style_shadow, 0)
|
||||
obj2.align(lv.ALIGN.CENTER, 60, 30)
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
def drag_event_handler(e):
|
||||
|
||||
obj = e.get_target_obj()
|
||||
|
||||
indev = lv.indev_active()
|
||||
|
||||
vect = lv.point_t()
|
||||
indev.get_vect(vect)
|
||||
x = obj.get_x() + vect.x
|
||||
y = obj.get_y() + vect.y
|
||||
obj.set_pos(x, y)
|
||||
|
||||
|
||||
#
|
||||
# Make an object draggable.
|
||||
#
|
||||
|
||||
obj = lv.obj(lv.screen_active())
|
||||
obj.set_size(150, 100)
|
||||
obj.add_event_cb(drag_event_handler, lv.EVENT.PRESSING, None)
|
||||
|
||||
label = lv.label(obj)
|
||||
label.set_text("Drag me")
|
||||
label.center()
|
||||
|
||||
Reference in New Issue
Block a user