bool_carver.py 文件源码

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

项目:ToolPlus 作者: mkbreuer 项目源码 文件源码
def DrawCenterText(text, xt, yt, Size, Color, self):
    font_id = 0
    # Offset Shadow
    Sshadow_x = 2
    Sshadow_y = -2

    blf.size(font_id, Size, 72)
    blf.position(font_id, xt + Sshadow_x - blf.dimensions(font_id, text)[0] / 2, yt + Sshadow_y, 0)
    bgl.glColor4f(0.0, 0.0, 0.0, 1.0)

    blf.draw(font_id, text)
    blf.position(font_id, xt - blf.dimensions(font_id, text)[0] / 2, yt, 0)
    if Color is not None:
        mColor = mathutils.Color((Color[0], Color[1], Color[2]))
        bgl.glColor4f(mColor.r, mColor.g, mColor.b, 1.0)
    else:
        bgl.glColor4f(1.0, 1.0, 1.0, 1.0)
    blf.draw(font_id, text)


# Draw text (Left position)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号