tweenlite:一次补间多个对象
我想知道当我尝试像这样补间多个对象并使用 onComplete 属性时是否会出现错误或其他问题:
TweenLite.to(restartBtn, .5, {alpha:0});
TweenLite.to(mainMenuBtn, .5, {alpha:0, onComplete:quitFadeIn});
我想要做的是一次淡出多个对象以及当它们完成特殊功能时被叫。使用 tweenlite 时是否还有其他可能性,或者我是否必须使用时间线?
I would like to know if I can get an error or some other problems when I try to tween several objects like this and using an onComplete-property:
TweenLite.to(restartBtn, .5, {alpha:0});
TweenLite.to(mainMenuBtn, .5, {alpha:0, onComplete:quitFadeIn});
What I want to do is fade out several objects at once and when they finished a special function gets called. Are there other possibilities when using tweenlite available or do I have to use timelinelite?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的示例代码应该可以正常运行,没有任何错误,如果您仅限于 TweenLite,那么这是一个非常好的使用方法。
如果您可以使用与 TweenLite 相同的 TweenMax,只是具有更多功能,您可以使用类似的方法来补间多个项目:
这将使淡入淡出 0.2 秒
Your sample code should work without any errors and if you're limited to TweenLite, this is a perfectly good method to use.
If you can use TweenMax which is the same as TweenLite, just with more features, you can use something like this to tween multiple items:
and this would stagger the fades by .2 seconds