2012-11-16 43 views
7


我是很新的andengine,欲以從git的URL這andengine例子:https://github.com/nicolasgramlich/AndEngineExamples
但它總是顯示我的兩類Andengine例子顯示錯誤不能正常工作

BoundCameraExample和HullAlgorithmExample 錯誤

在結合的相機例如錯誤是在管線220表示:

類型不匹配:不能從空轉變爲AnimatedSprite

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

HullAlgorithmExample錯誤是DrawMode的import語句
錯誤顯示的行數11:進口org.andengine.entity.primitive.vbo。 DrawMode;
和168行,17​​5說我使用的Java編譯器1.6的所有擴展 我下載andengine和擴展來自同一個混帳回購協議DrawMode不能被解析爲一個變量

。 這有什麼 去錯了,請幫我

由於allll

回答

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; 
+0

謝謝Swati快速回答....謝謝 –

+1

非常歡迎您! –

+1

即時通訊也面臨同樣的問題,我讀了與這個問題有關的總線程,但你做得更容易。它的工作 – Ravikumar11

11

2014 @斯瓦特-拉瓦特的答案仍然是heplful。我發現了另外兩個問題,我會在這裏報告的解決方案,因爲這個問題是很好排名:

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); 
+1

好聽!感謝分享.. – kingAm