7


我对 andengine 很陌生,试图从 git url 使用这个 andengine 示例:https
://github.com/nicolasgramlich/AndEngineExamples 但它总是向我显示两个类的错误

BoundCameraExample 和 in HullAlgorithmExample

绑定相机示例错误在第 220 行中说:

类型不匹配:无法从 void 转换为 AnimatedSprite

final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager()).animate(100);

并且在HullAlgorithmExample 错误是在
第 11 行显示 DrawMode 错误的导入语句:import org.andengine.entity.primitive.vbo.DrawMode;
在第 168、175 行中说 DrawMode 无法解析为变量

我对我从同一个 git repo 下载的所有扩展和引擎和扩展使用 java 编译器 1.6。这是怎么回事请帮帮我

感谢所有

4

2 回答 2

32

在 BoundCameraExample 中,尝试

final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion,  this.getVertexBufferObjectManager());
face.animate(100);

代替

final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion,  this.getVertexBufferObjectManager()).animate(100);

在 HullAlgorithExample 中,导入

import org.andengine.entity.primitive.DrawMode;

代替

import org.andengine.entity.primitive.vbo.DrawMode;
于 2012-11-16T05:30:19.903 回答
11

在 2014 年,@swati-rawat 的回答仍然很有帮助。我发现了另外两个问题,我将在这里报告解决方案,因为这个问题排名很高:

SplitScreenExample 中,如在 BoundCameraExample 中,替换为:

final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager());
face.animate(100);

TextBreakExample中替换为:

this.mText = new Text(50, 40, this.mFont, "", 1000, new TextOptions(AutoWrap.LETTERS, AUTOWRAP_WIDTH, HorizontalAlign.CENTER, Text.LEADING_DEFAULT), vertexBufferObjectManager);
于 2014-02-28T11:04:51.623 回答