【问题标题】:Andengine examples shows error not workingAndengine 示例显示错误不起作用
【发布时间】:2012-11-04 20:03:26
【问题描述】:


我对 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);

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

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

感谢大家

【问题讨论】:

    标签: andengine


    【解决方案1】:

    在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;
    

    【讨论】:

    • 我也面临同样的问题,我阅读了与此问题相关的全部线程,但您变得非常容易。它的工作
    【解决方案2】:

    在 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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-26
      • 1970-01-01
      • 2017-02-21
      • 1970-01-01
      相关资源
      最近更新 更多