当前位置: 动力学知识库 > 问答 > 编程问答 >

android - React Native and Physics Based Animations

问题描述:

I've been learning React Native and while things are going well, I'd like to work on getting some animations into some of my React apps.

I see that react has it's own animations page, but these seem to mostly be based on transitions and changes such as scaling and such.

I also found react-native-art-svg which provides an SVG interface to React Native. It seems like one could do a lot with this.

But what if someone wanted to take it further? I want to build an app where certain pages may have some physics based animations. Collision detection, gravity, that kind of stuff. For example: an app where a button is pressed and water flows out of the tap and into a container. Or rather than water, to keep it simpler, a small box falls into a container. Another does when it's clicked again, and the two interact before settling at the bottom of the container. And so on. I'd also want to be able to use the phones gyroscope to detect the orientation of the phone, so that when the phone is tipped, all of hte objects in the container move appropriately.

What is the best way to go about doing this? Is this possible with React apps? Will I need an external library? Which libraries would be the best for this? Would these libraries work in both Android and iOS?

分享给朋友:
您可能感兴趣的文章:
随机阅读: