Moving the object in a certain radius towards the click



  • Hello. There's a circle inside the circle, a circle smaller. I need the inner circle to move towards the click, but not beyond the wider circle. Like tochpad in libgdx, but it only responds to clicks inside the circle.



  • Try redefining the method hit Class Touchpad as follows:

    @Override
    public Actor hit (float x, float y, boolean touchable) {
        return this;
    }
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2