Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Andengine examples shows error not working

Tags:

andengine


I am very new to andengine, trying to use this andengine examples from git url : https://github.com/nicolasgramlich/AndEngineExamples
But it always shows me error on two classes

BoundCameraExample and in HullAlgorithmExample

In bound camera example error is in line 220 says :

Type mismatch: cannot convert from void to AnimatedSprite

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

and in HullAlgorithmExample error is on import statement of DrawMode
error shows on line number 11 : import org.andengine.entity.primitive.vbo.DrawMode;
and in lines 168 , 175 says DrawMode cannot be resolved to a variable

I am using java compiler 1.6 for all extensions I downloaded andengine and extensions from the same git repo. What is going wrong with this please help me

Thanks to allll

like image 822
Renjith K N Avatar asked Nov 16 '12 05:11

Renjith K N


2 Answers

In the BoundCameraExample, try

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

instead of

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

In the HullAlgorithExample, import

import org.andengine.entity.primitive.DrawMode;

instead of

import org.andengine.entity.primitive.vbo.DrawMode;
like image 107
Swati Rawat Avatar answered Dec 14 '22 22:12

Swati Rawat


In 2014 the answer of @swati-rawat is still heplful. I found further two issues, I'll report here the solution since this question is well ranked:

in SplitScreenExample, as in BoundCameraExample, replace with:

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

in TextBreakExample replace with:

this.mText = new Text(50, 40, this.mFont, "", 1000, new TextOptions(AutoWrap.LETTERS, AUTOWRAP_WIDTH, HorizontalAlign.CENTER, Text.LEADING_DEFAULT), vertexBufferObjectManager);
like image 37
donnadulcinea Avatar answered Dec 14 '22 23:12

donnadulcinea