Andengine示例显示错误无效

Ren*_*K N 7 andengine


我是andengine的新手,尝试使用git url中的这个andengine示例:https://github.com/nicolasgramlich/AndEngineExamples
但它始终显示我两个类上的错误

BoundCameraExample和HullAlgorithmExample

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

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

final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager()).animate(100);
Run Code Online (Sandbox Code Playgroud)

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

我正在使用java编译器1.6为我从同一个git repo下载andengine和扩展的所有扩展.这有什么问题请帮助我

感谢allll

Swa*_*wat 32

在BoundCameraExample中,尝试

final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion,  this.getVertexBufferObjectManager());
face.animate(100);
Run Code Online (Sandbox Code Playgroud)

代替

final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion,  this.getVertexBufferObjectManager()).animate(100);
Run Code Online (Sandbox Code Playgroud)

在HullAlgorithExample中,导入

import org.andengine.entity.primitive.DrawMode;
Run Code Online (Sandbox Code Playgroud)

代替

import org.andengine.entity.primitive.vbo.DrawMode;
Run Code Online (Sandbox Code Playgroud)


don*_*nea 11

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

SplitScreenExample,如BoundCameraExample,更换:

final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager());
face.animate(100);
Run Code Online (Sandbox Code Playgroud)

TextBreakExample中替换为:

this.mText = new Text(50, 40, this.mFont, "", 1000, new TextOptions(AutoWrap.LETTERS, AUTOWRAP_WIDTH, HorizontalAlign.CENTER, Text.LEADING_DEFAULT), vertexBufferObjectManager);
Run Code Online (Sandbox Code Playgroud)