Firemonkey 浮动键动画,转到特定键
在 Firemonkey 2d 应用程序中,我使用浮动键尝试围绕时钟移动 TLine 控件。我为分针添加了 60 个关键帧,为时针添加了 12 个关键帧(实际上这是更多的关键帧,因为我在位置 x、位置 y、高度和宽度上添加了一个)。
所以,现在我有两个问题:
如何播放关键帧,然后从关键帧开始并转到下一个关键帧?
如何转到特定关键帧? (即我加载一个表单并希望显示当前时间)
注意,我正在做这只是为了更多地了解 Delphi XE2,而不是为了解决任何特定的业务解决方案。
In a Firemonkey 2d application, I'm using a float key to attempt to move a TLine control around a clock. I've added 60 key frames for the minute hand and 12 key frames for the hour hand (actually it's a lot more keys because I added one on position x, position y, height and width).
So, now I have two questions:
How do I play to a key frame, then start at a key frame and go to the next key frame?
How do I go to a particular key frame? (i.e. I load a form and I want to show the current time)
Note, I'm doing this just to learn more about Delphi XE2, not to solve any particular business solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我还没试过但是。
您可以使用 TAnimations 过程
,并在从头开始动画后立即调用它,并使用增量时间将您置于正确的关键点。
请注意,该函数还包含一个时间参数,但该参数似乎在代码中被忽略,否则您可能可以使用它来设置当前时间。
I haven't tried it but.
You could use perhaps use TAnimations procedure
And call it right after you start your animation from scratch with a deltatime that will place you at the correct key.
Note that the function includes a time parameter too but that one seem to be ignored in code, otherwise you could probably use that to set the current time.