AndEngine 环境配置出错解决

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

 

解决办法:

[java] view plaincopy
  1. final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager()).animate(100);  


 

改为

[java] view plaincopy
  1. final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager());  
  2.   
  3.   
  4. 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

 

解决办法:

[java] view plaincopy
  1. this.mText = new Text(5040this.mFont, ""1000new TextOptions(AutoWrap.LETTERS, AUTOWRAP_WIDTH, Text.LEADING_DEFAULT, HorizontalAlign.CENTER), vertexBufferObjectManager);  
  2.           

 

改为:

[java] view plaincopy
  1. this.mText = new Text(5040this.mFont, ""1000new TextOptions(AutoWrap.LETTERS, AUTOWRAP_WIDTH,  HorizontalAlign.CENTER, Text.LEADING_DEFAULT), vertexBufferObjectManager);  


 错误三:

DrawMode cannot be resolved to a variable

 

解决办法:

 

[java] view plaincopy
  1. import org.andengine.entity.primitive.vbo.DrawMode;  


改为:

 

[java] view plaincopy
  1. import org.andengine.entity.primitive.DrawMode;  


 

 

posted on 2013-03-03 13:10  jackrex  阅读(406)  评论(0编辑  收藏  举报

导航