我想制作
Android动态壁纸.我想使用LibGDx.我发现了这个信息:
http://www.badlogicgames.com/wordpress/?p=2652
不幸的是,我的壁纸复制代码,eclipse显示错误.
有谁知道如何使用LibGDx制作壁纸?
Eclipse显示以下信息:“MyApplicationListener无法解析为某个类型”?
有3个快速修复:
1.创建类MyApplicationListener
2.更改为“ApplicationListener”(com.badlogic.gdx)
3.修复项目设置
选择2修复后,eclipse显示另一个错误:
“无法实例化ApplicationListener类型”
我用HaMMeReD的帮助解决了我的问题.
我在android项目中的代码:
public class MainActivity extends AndroidLiveWallpaperService {
@Override
public ApplicationListener createListener(boolean isPreview) {
// TODO Auto-generated method stub
return new SexyWomen();// here should be wrote name of class form main LibGDx project
}
@Override
public AndroidApplicationConfiguration createConfig() {
// TODO Auto-generated method stub
return new AndroidApplicationConfiguration();
}
@Override
public void offsetChange(ApplicationListener listener, float xOffset, float yOffset, float xOffsetStep, float yOffsetStep,
int xPixelOffset, int yPixelOffset) {
// TODO Auto-generated method stub
Gdx.app.log("LiveWallpaper", "offset changed: " + xOffset + ", " + yOffset);
}
}