Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我想让stop的持续时间久一些,需要怎么做呢? #43

Closed
feacx opened this issue Nov 26, 2020 · 3 comments
Closed

我想让stop的持续时间久一些,需要怎么做呢? #43

feacx opened this issue Nov 26, 2020 · 3 comments

Comments

@feacx
Copy link

feacx commented Nov 26, 2020

this.$refs.LuckyWheel.stop(Math.random() * 8 >> 0)
这个结束的速度太快了,我想给用户一点刺激的紧迫感,应该如何改源码呢,没找到哎,谢谢亲

@buuing
Copy link
Owner

buuing commented Nov 26, 2020

this.$refs.LuckyWheel.stop(Math.random() * 8 >> 0)
这个结束的速度太快了,我想给用户一点刺激的紧迫感,应该如何改源码呢,没找到哎,谢谢亲

源码基于TS编译:lucky-canvas
slowDown 方法里使用了张鑫旭大佬的 tween.js 的二次方缓动函数来实现的停止逻辑

@buuing
Copy link
Owner

buuing commented Nov 26, 2020

我更建议你使用defaultConfig.decelerationTime来微调缓慢停止时间,建议范围1000 ~ 5000
用着顺手可以点个 star 支持一下

@feacx
Copy link
Author

feacx commented Nov 26, 2020

我更建议你使用defaultConfig.decelerationTime来微调缓慢停止时间,建议范围1000 ~ 5000
用着顺手可以点个 star 支持一下

谢谢大佬,可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants