Thursday 15 March 2012

android - AndEngine Popup Scene Error -



android - AndEngine Popup Scene Error -

i making brick breaker game , want show popup when ball hits ground. however, tried both set children scene or create popup object , add together entity. both of methods have same errors show below.

could 1 give me advice?

thank you!

public scene onloadscene() { this.mengine.registerupdatehandler(new fpslogger()); scene.registerupdatehandler(new iupdatehandler() { public void reset() { } public void onupdate(final float psecondselapsed) { if(ball.collideswith(paddle)) { ball.bouncewithrectangle(paddle); } else if (ball.gety() >= game.getcamera_height() - 30) { scene.setbackground(new colorbackground(255f, 0f, 0f)); scene.setignoreupdate(true); **scene.setchildscene(pausescene(), false, true, true); //scene.gettoplayer().addentity(popup);** } }

updated pausescene():

public scene pausescene() { scene pausescene = new scene(1); texture mtexture = new texture(256, 256, textureoptions.bilinear); textureregionfactory.setassetbasepath("popup/"); textureregion texttextregion = textureregionfactory.createfromasset(mtexture, this, "canvas.jpg", 0, 0); sprite box = new sprite(0, 0, texttextregion); pausescene.gettoplayer().addentity(box); homecoming pausescene; }

============================================================ other try:

public dialog oncreatedialog() { alertdialog.builder builder = new alertdialog.builder(this.getapplicationcontext()); builder.setmessage("hello"); alertdialog alert = builder.create(); homecoming alert; }

android popup andengine

No comments:

Post a Comment