温馨提示:该项目除了使用BSD协议授权外,还需遵守附加的专利授权。
Reboud是一个来自Facebook公司的Adroid的物理和动画库,我们相信对真实世界的物理建模是一个有力的方式,方便在应用中创建自然、可触的动画和交互效果。
示例代码:
// Create a system to ru the physics loop for a set of sprigs. SprigSystem sprigSystem = SprigSystem.create(); // Add a sprig to the system. Sprig sprig = sprigSystem.createSprig(); // Add a listeer to observe the motio of the sprig. sprig.addListeer(ew SimpleSprigListeer() { @Override public void oSprigUpdate(Sprig sprig) { // You ca observe the updates i the sprig // state by askig its curret value i oSprigUpdate. float value = (float) sprig.getCurretValue(); float scale = 1f - (value * 0.5f); myView.setScaleX(scale); myView.setScaleY(scale); } }); // Set the sprig i motio; movig from 0 to 1 sprig.setEdValue(1);






评论