[英]How can I dynamically move/resize a form?
I am doing an alert system that will show messages 'a la' Messenger, and I want them to move or resize to make them appear. 我正在执行一个警报系统,该系统将显示消息“ la la Messenger”,并且希望它们移动或调整大小以使其出现。
How can I do this without having to do this: 我如何做到这一点而不必这样做:
do
{
this.prop += 1;
} while (this. prop = destination);
设置form.size
属性以更改大小,设置form.position
以更改位置
You need a frame rate independent interpolator. 您需要一个独立于帧率的插值器。
Take a look at: Frame Rate Independent interpolation . 看一下: 独立于帧速率的插值 。 Basically, the idea is that you compute what your current position should be based upon the expected animation time and how long you've been animating... This means that the animation will take the same amount of time to go from point a to point b on any hardware. 基本上,您的想法是根据预期的动画时间和进行动画的时间来计算当前位置应该是多少...这意味着动画从点到点花费的时间相同b在任何硬件上。
Of course, you'll need to position the form with the values coming out of this, but thats the easy part! 当然,您需要使用由此产生的值来定位表单,但这很简单!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.