用pygame绘制旋转字体 [英] draw rotated font with pygame

查看:126
本文介绍了用pygame绘制旋转字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用pygame绘制用字体渲染的旋转文本的最佳方法是什么?我可以先绘制字体然后 RoomZoom ,但是如果可以绘制直接旋转的字形,尤其是考虑到AA,似乎可以得到更好的结果?

What's the best way to draw rotated text rendered with fonts with pygame? I can just draw the font then rotozoom it, but it seems better result would be gotten if it were possible to draw the glyphs directly rotated, especially taking AA into account?

推荐答案

您可以在pygame中使用pyOpenGL表面,如果这样做可以简化的话.Pyglet还使用OpenGL.

You can use a pyOpenGL surface in pygame, if that simplifies it for you. Pyglet also uses OpenGL.

(用于pygame曲面)您可以缓存渲染的文本,并使用该文本进行旋转.或预缓存所有32个方向.[查看其他答案]

(for pygame surfaces) You can cache the rendered text, using that to rotate. Or pre-cache all 32 directions. [ see other answer ]

这篇关于用pygame绘制旋转字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆