def screen_frames(status_height=24):
w, h = ui.get_screen_size() # (1024, 768) on iPad in landscape mode
assert w > h, 'This app only works in landscape mode!!'
square_side = min(w, h) - status_height # make room for a line of status text
panel_width = (w - square_side) / 2
center_frame = sk.Rect(panel_width, 0, square_side, square_side)
left_frame = sk.Rect(0, 0, panel_width, square_side)
right_frame = sk.Rect(panel_width + square_side, 0, panel_width, square_side)
status_frame = sk.Rect(0, square_side, w, status_height)
return center_frame, left_frame, right_frame, status_frame
#print(screen_frames())
评论列表
文章目录