Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] atualiza texto na tela andEngine


02-27 16:18:36.860: E/AndroidRuntime(7126): FATAL EXCEPTION: UpdateThread
02-27 16:18:36.860: E/AndroidRuntime(7126): java.lang.ArrayIndexOutOfBoundsException

Geralmente esse erro ocorre quando voce da um attach ou detach de um elemento fora da updateThread.
Sugiro que voce procure os pontos do codigo onde está atachando/desatachando sprites e substitua por:

getEngine.runOnUpdateThread(new Runnable() {
@Override
public void run() {
                        //attach ou detach aqui
}
});

Abs,
Rodrigo Dias.



On Wed, Feb 27, 2013 at 3:35 PM, Diego Lopes Marques da Silva <diego.lopes@dce.ufpb.br> wrote:
Coloca um unregisterTouchArea(lek1);

Em 27 de fevereiro de 2013 15:33, Felipe Cauê Legal Benedito <felipecaue.lb@gmail.com> escreveu:

A ideia di switch funcionou Diego Lopes, porem quando o bicho fica invisível a área de touch ainda fica ativa e consigo clicar mesmo sem ter o bicho na tela.

mDelayTimeHandler1 = new TimerHandler(LekTime, new DelayTimerCallback1()); //DEFINE UM TIMER PARA COMTROLE DE APARIÇÃO DO LEK 1
lek1 = new AnimatedSprite(230, 215, this.mLekTextureRegion, vertexBufferObjectManager) {
@Override
public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
switch (pSceneTouchEvent.getAction()) { 
                case TouchEvent.ACTION_UP:
                scene.detachChild(lek1);
        countLek+=1;
        centerText.setText(String.valueOf(countLek));
        mDelayTimeHandler1.reset();
        break;
}
return true;
}
};
lek1.setScaleCenterY(this.mLekTextureRegion.getHeight());
lek1.setScale(1.4f);
lek1.animate(new long[]{150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150}, 0, 14, true);
scene.attachChild(lek1);
scene.registerTouchArea(lek1);  <==== SERIA ESTA PARTE QUE FAZ COM QUE A ÁREA DE TOQUE NÃO DESAPAREÇA?
scene.registerUpdateHandler(mDelayTimeHandler1);
mDelayTimeHandler1.setTimerCallbackTriggered(true);

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário