cairo_wadaane.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:pedro 作者: saandial 项目源码 文件源码
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
# ---------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号