1. 首先下载AndEngine 源码 和 example和八个扩展,下载后,解压。
2.讲10个解压包导入到eclipse(会有错误),
首先,将AndEngine 选择项目--》 属性,选择java compiler,将右侧的 compiler compliance level 改为 1.6 。
其次,针对AndEngine的八个扩展,同样安装上述方法,把compiler compliance level 改为1.6,然后分别导入刚才编译好的 AndEngine的jar包。
最后,针对example,把compiler compliance level 改为1.6,导入刚才编译好的AndEngine的jar包的同时,还要导入刚才编译好的八个扩展的jar包。
做完以上步骤,仍会有些错误:
错误一:
Description Resource Path Location Type
Type mismatch: cannot convert from void to AnimatedSprite BoundCameraExample.java /AndEngineExamples/src/org/andengine/examples line 220 Java Problem
解决办法:
- final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager()).animate(100);
改为
- final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager());
- face.animate(100);
错误二:
Description Resource Path Location Type
The constructor TextOptions(AutoWrap, float, float, HorizontalAlign) is undefined TextBreakExample.java /AndEngineExamples/src/org/andengine/examples line 106 Java Problem
解决办法:
- this.mText = new Text(50, 40, this.mFont, "", 1000, new TextOptions(AutoWrap.LETTERS, AUTOWRAP_WIDTH, Text.LEADING_DEFAULT, HorizontalAlign.CENTER), vertexBufferObjectManager);
改为:
- this.mText = new Text(50, 40, this.mFont, "", 1000, new TextOptions(AutoWrap.LETTERS, AUTOWRAP_WIDTH, HorizontalAlign.CENTER, Text.LEADING_DEFAULT), vertexBufferObjectManager);
错误三:
DrawMode cannot be resolved to a variable
解决办法:
- import org.andengine.entity.primitive.vbo.DrawMode;
改为:
- import org.andengine.entity.primitive.DrawMode;