Delphi Firemonkey中的鼠标事件动画
我添加了一个按钮并向其添加了一个 BoxBlurEffect,并将以下属性设置为 BoxBlurEffect1
。
//extracted form fmx file
object BoxBlurEffect1: TBoxBlurEffect
Trigger = 'IsMouseOver=true'
Enabled = False
BlurAmount = 0.009999999776482582
object FloatAnimation1: TFloatAnimation
AnimationType = atInOut
Enabled = True
Duration = 1.000000000000000000
Loop = True
Trigger = 'IsMouseOver=true'
TriggerInverse = 'IsMouseOver=false'
StartValue = 0.009999999776482582
StopValue = 10.000000000000000000
PropertyName = 'BlurAmount'
end
end
我设置了loop = true,因为如果它是false,它就不会动画,它只是突然达到最终值。
所以我把它设置为true。但现在它是循环的(正如名称所描述的),而不仅仅是动画一次然后停止。
而且我还希望当我离开鼠标时它从停止值动画到开始值(仅一次)。当我的鼠标离开或进入时,新动画必须从当前值开始,而不是从最大值或最小值开始。
I have added a button and added a BoxBlurEffect to it and set following attributes to the BoxBlurEffect1
.
//extracted form fmx file
object BoxBlurEffect1: TBoxBlurEffect
Trigger = 'IsMouseOver=true'
Enabled = False
BlurAmount = 0.009999999776482582
object FloatAnimation1: TFloatAnimation
AnimationType = atInOut
Enabled = True
Duration = 1.000000000000000000
Loop = True
Trigger = 'IsMouseOver=true'
TriggerInverse = 'IsMouseOver=false'
StartValue = 0.009999999776482582
StopValue = 10.000000000000000000
PropertyName = 'BlurAmount'
end
end
I set loop = true because if it is false it is not animating it is just suddenly going to end value.
So I set it to true. But now it is looping (as the name described) not just animating once and stopping.
And also I want it to animate from stop value to start value when I leave the mouse (only once). When my mouse leaves or enters, the new animation must start from current value not from the max or min value.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
触发器并不总是像我期望的那样工作......
你可以这样做:
没有 TFloatAnimation:
Trigger doesn't always work as I expect neither...
You can do it like this:
Without TFloatAnimation: