首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >寻找XPCE教程

寻找XPCE教程
EN

Stack Overflow用户
提问于 2011-01-20 12:16:12
回答 1查看 1.1K关注 0票数 1

我将用XPCE编写一个简单的动画(准确地说,是四杯拼图)。我对XPCE一无所知,所以我查了一个教程,但是结果令人失望。有谁能告诉我以下几点资料:

  • 使用“画布”
  • 动画
  • 定时器

编辑:好的,这里有一个更详细的问题:我想画两个盒子,等待两秒钟,隐藏这些盒子,然后启动一个计时器。

代码语言:javascript
复制
new(@box1, box(100,100)),
send(W, display, @box1),
new(@box2, box(100,100)),
send(W, display, @box2, point(200, 200)),

% wait two seconds here
% hide the boxes here

new(Msg1, and(message(B1, relative_move, point(5, 0)),
              message(B4, relative_move, point(0, 5)))),
send(W, attribute, attribute(timer, new(T, timer(0.1, Msg1)))),

send(T, start),

编辑2:好的,这是另一个问题(我应该打开一个新问题吗?):这是我正在使用的代码:

代码语言:javascript
复制
get_file(0, 'glass.gif').
get_file(180, 'glass180.gif').

main(GA, GB, GC, GD) :- % e.g. main(0,0,180,0).
    new(B1, figure),
    get_file(GA, G1),
    send(B1, display, new(BM1, bitmap(G1))),
    send(BM1, transparent, @on),
    send(W, display, B1, point(0,0)),     

%analogically for the other three glasses

我想为B1设置一个新的位图。我该怎么做?改变BM1就足够了吗?还是有其他的解决办法?我一直在考虑把垂直眼镜和反眼镜都画在屏幕外,然后换掉它们,但我不确定这种解决方案的细节。

EDIT2 2‘:解决它。为子孙后代:

代码语言:javascript
复制
send(B1, clear),
send(B1, display, bitmap('glass_while_animating_1.gif')),
send(timer(0.1), delay),
send(B1, clear),
send(B1, display, bitmap('glass_while_animating_2.gif')),
% etc
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-01-20 22:55:17

这个可搜索的pdf会有帮助吗?

链接文本

“第五章.简单的图形”谈到了一幅画(即。(画布)

在第260页中,有一个使用计时器来引入延迟的例子,第266页显示了使用计时器显示闪烁的图形。

在第40页中,提到了使用“图形->刷新”来显式强制重绘。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4746989

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档