admin管理员组文章数量:1319935
Good day, friends! I would like to use existing drawable object like pyglet.shapes.Rectangle, pyglet.shapes.Line or pyglet.text.Label and add some shader effects like scaling over time, changing color over time.
class TestLabel(Label):
def __init__(self):
super().__init__(
text="y",
font_name="Arial",
font_size=90,
color=(0, 0, 255, 255),
x=640, y=390)
def scale(self, factor, time):
# Slowly grow over time
pass
def change_color(self, to_this_color, time):
# Transition rgba values of label to target color within the time
pass
Is this even an option? Do I really have to create a custom class including a shader program from the ground up if I would like to have a blinking/scaling rectangle? Do I really have then to implement custom events, behaviour etc.?
Does someone have code for blinking/scaling rectangle?
本文标签: pythonAdding shaders to existing shapeslabelsdrawablesStack Overflow
版权声明:本文标题:python - Adding shaders to existing shapes, labels, drawables? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742061335a2418605.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论