I'm trying to make 2 separate classes, 1 a VirtualJoystick class and 1 a VirtualButton class. I want to implement a GestureListener class in each, it just seems like good code to do so, but when I go to my main program, how do I add both GestureListener classes?
Here's some pseudocode that I'm thinking of:
VirtualJoystick vjs = new VirtualJoystick(x, y, width, height, bgImage, fgImage); VirtualButton vb = new VirtualButton(x, y, width, height, upImage, dnImage); GestureDetector joyGestureDetector = new GestureDetector( vjs.getDetector() ); GestureDetector btnGestureDetector = new GestureDetector( vb.getDetector() ); // Here's what I don't know how to do GestureDetector combinedGestureDetector = ? Gdx.input.setInputProcessor(combinedGestureDetector);
but as you can see, I'm stuck on how to combine the two, if there's a better way let me know, I'm just trying to get my code to "think through well" and be atomically contained in classes.