将缓动函数应用于 PathModifier?
在 AndEngine 中我以这种方式定义了一个 PathModifier
public static IEaseFunction EASEFUNCTION;
EASEFUNCTION =EaseSineInOut.getInstance();
float[] coordinatesX = new float[300], coordinatesY = new float[300];
for (int i=0; i<300; i++){
coordinatesX[i] = i;
coordinatesY[i] = (float)(20 * (Math.sin((-0.10 * coordinatesX[i]))));
System.out.println(coordinatesX[i]);
System.out.println(coordinatesY[i]);
}
PathModifier path = new PathModifier(10, coordinatesX, coordinatesY, EASEFUNCTION);
它是一个数学函数。我想将 EASEFunction 应用于我创建的 PathModifier。构造函数存在,但在这种情况下没有一个 EASEFunction 不起作用。出什么问题了?
In AndEngine I defined a PathModifier in this way
public static IEaseFunction EASEFUNCTION;
EASEFUNCTION =EaseSineInOut.getInstance();
float[] coordinatesX = new float[300], coordinatesY = new float[300];
for (int i=0; i<300; i++){
coordinatesX[i] = i;
coordinatesY[i] = (float)(20 * (Math.sin((-0.10 * coordinatesX[i]))));
System.out.println(coordinatesX[i]);
System.out.println(coordinatesY[i]);
}
PathModifier path = new PathModifier(10, coordinatesX, coordinatesY, EASEFUNCTION);
It's a mathematical function. I wanna to apply an EASEFunction to the PathModifier created by me. The constructor exists but none of the EASEFunctions don't works in this case. What's going wrong ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要首先创建
Path
对象,然后将其传递给PathModifier
构造函数。这会起作用:
我强烈建议您下载 AndEngine 的源代码,这样您就可以快速轻松地修复此类小问题。
You need to create the
Path
object first, then pass it to thePathModifier
constructor.This will work:
I highly recommend you to download AndEngine's source code, so you can fix such small issues fast and with ease.