使用 pyclutter 进行编程
我一直在尝试使用 pyclutter。到目前为止我还没有找到任何好的教程。我的意思是没有真正正确解释的内容。我看到了几个示例程序,但是当我尝试使用 pyclutter 时,我没有得到任何好的结果。
这些命令可用,但它们的正确使用才是导致问题的原因。我尝试使用 pyclutter 渲染一条线,但甚至无法做到这一点。
我的代码:
import clutter
from clutter import cogl
stage = clutter.Stage()
stage.set_size(400, 400)
label = clutter.Text()
label.set_text("line")
stage.add(label)
clutter.cogl.set_source_color4ub (255,0,0,255)
clutter.cogl.path_line(100,100,200,200)
clutter.cogl.path_stroke()
stage.show_all()
stage.connect("destroy",clutter.main_quit)
clutter.main()
我的错误可能真的很愚蠢,但如果有人能给我指出一个很好的教程,我可以从中学习杂乱(pyclutter)并帮助我,我将非常感激。
I am new to clutter (and pyclutter).
I have been trying to use pyclutter. I haven't found any good tutorial for it so far. I mean nothing that really explains properly. I saw a couple of example programs but when I tried to use pyclutter I didn't get any good results.
The commands are available but their proper use is what is causing a problem. I tried to render a line using pyclutter but haven't even been able to do that.
My code:
import clutter
from clutter import cogl
stage = clutter.Stage()
stage.set_size(400, 400)
label = clutter.Text()
label.set_text("line")
stage.add(label)
clutter.cogl.set_source_color4ub (255,0,0,255)
clutter.cogl.path_line(100,100,200,200)
clutter.cogl.path_stroke()
stage.show_all()
stage.connect("destroy",clutter.main_quit)
clutter.main()
It's possible that my mistakes are really stupid, but I'd be really grateful if anyone could point me to a good tutorial where i can learn clutter (pyclutter) from and help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个怎么样: http://www.tuxradar.com/content/clutter-beginners-教程。看起来相当不错。
What about this one: http://www.tuxradar.com/content/clutter-beginners-tutorial. It looks pretty decent.