android - gles2 Moving a sprite with an AnalogController -
hello new andengine , have been using andengine cookbook , have reached part creating analogcontroller. have written code move , rotate sprite whenever run runtime error.
mcontroller = new analogonscreencontrol(controllerx, controllery, mcamera, controllerbaseregion, controllerknobregion, 0.1f, mengine.getvertexbufferobjectmanager(), new ianalogonscreencontrollistener() { @override public void oncontrolchange( // todo auto-generated method stub // pvalues direction of dragging baseonscreencontrol pbaseonscreencontrol, float pvaluex, float pvaluey) { mainsprite.setposition(mainsprite.getx() + (pvaluex + 2), mainsprite.gety() + (pvaluey + 2 )); mainsprite.setrotation(pvaluex); log.d("mainsprite", string.valueof(mainsprite.getrotation())); }
Comments
Post a Comment