def demo_PathView():
# SETUP
p = ui2.get_regular_polygon_path(6, center=(50, 50), radius=50)
pv = ui2.PathView(p)
pv.x = 150
pv.y = 150
# ANIMATION FUNCTIONS
def scaleWidth():
pv.width = 200
def scaleHeight():
pv.height = 200
def scaleBoth():
pv.width = 300
pv.height = 300
def scaleBack():
pv.x, pv.y = 0, 0
pv.width, pv.height = 50, 50
# BASIC USAGE
v = ui.View(background_color="white")
v.width = v.height = 500
v.add_subview(pv)
v.present("sheet", hide_title_bar=True)
# PERFORM THE ANIMATIONS
ui.animate(scaleWidth, 1)
ui.delay(lambda: ui.animate(scaleHeight, 1), 1)
ui.delay(lambda: ui.animate(scaleBoth, 1), 2)
ui.delay(lambda: ui.animate(scaleBack, 1), 3)
评论列表
文章目录