Android onscreen joystick issues

后端 未结 2 1515
难免孤独
难免孤独 2021-01-06 05:23

So I\'m trying to build a game with an on-screen joystick that moves a bitmap around the screen. But when I hold the joystick down in any direction and keep it there, the bi

相关标签:
2条回答
  • 2021-01-06 05:59

    It was because I only had the code to increment the bitmaps location in the onTouch method. When the screen is being touched but not moving a event is not registered. The code below should be outside the onTouch method.

    bitmapPoint.x += a * .05;
    bitmapPoint.y += b * .05;
    
    0 讨论(0)
  • 2021-01-06 06:08

    Try this It is open source api for on screen joystick for Android.

    0 讨论(0)
提交回复
热议问题