jichensheng / fish_2 Goto Github PK
View Code? Open in Web Editor NEW灵动的红鲤鱼完整版
灵动的红鲤鱼完整版
用Android Studio自带的模拟器,在7.0ROM下运行。
每次点击一个位置,鱼头总是先偏向右下角,再转向其他地方。
//计算鱼身旋转角度
oa.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float fraction = animation.getAnimatedFraction();
pathMeasure.getPosTan(pathMeasure.getLength()*fraction, null, tan);
float angle = (float) Math.toDegrees(Math.atan2(-tan[1], tan[0]));
//这里算出来的角度 无论什么情况 都是在-30°到-50°之间
Log("角度为:%f", angle);
mFish.setMainAngle(angle);
}
});
可能这样描述不清楚,可以告诉我您的邮箱吗,我录一小段视频发给您看看。
里面的起点和终点是鱼的头部和终点,控制点是点击的位置和鱼中心的位置吗
NoSuchMethodError: android.animation.ObjectAnimator.ofFloat
at com.example.admin.fishdemo.FishDrawableView.makeTrail(FishDrawableView.java:132)
我运行时FishDrawableView报错
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.