def draw_text(ctx):
ctx.select_font_face("Purisa", cairo.FONT_SLANT_NORMAL,
cairo.FONT_WEIGHT_NORMAL)
ctx.set_font_size(TXT_SIZE)
ctx.move_to(0.01*SIZE, TXT_SIZE)
ctx.show_text('Base: ' + str(int(degrees(base))))
ctx.move_to(0.01*SIZE, 2*TXT_SIZE)
ctx.show_text('Forearm: '+ str(int(degrees(forearm))))
ctx.move_to(0.01*SIZE, 3*TXT_SIZE)
ctx.show_text('Hand: '+ str(int(degrees(hand))))
if outOfReach:
ctx.set_source_rgb(1, 0, 0)
ctx.move_to(0.01*SIZE, 4*TXT_SIZE)
#ctx.move_to(-3*TXT_SIZE + Width/2, 0.5*SIZE + Height/2)
ctx.show_text('OUT OF REACH !!!')
# ---------------------------------
# mouse_pressed
# ---------------------------------
评论列表
文章目录