I've been working on a project lately, for my homework.
Well, going to the point, I have a Screen implementation of Scene2D, the issue I have is that my touch events on the widgets I have don't stop on the widgets.
I mean, If i popup a window, and try to move it, it also triggers the panning on my graphic, or if I move a slider, it also pans the camera.
Here's my project on GitHub
My events are configured on the class Pantalla on Core, Here
Thanks in advance.
Your problem is that you are using the stage with all actors (widgets etc) as input processor for camera gesture actions. It means that whenever you will apply some gesture on any actor that belongs to it it will trigger.
The solution is to create another stage only for camera gestures over the current stage. So your code should looks like:
//show method
viewport = new FitViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
// Creamos el stage, el cual albergara los botones entre otras cosas
stage = new Stage(viewport);
cameraStage = new Stage(viewport); //I'm not super-sure if you can user viewport second time - if not create new one
...
//render method
stage.act();
stage.draw();
cameraStage.act();
cameraStage.draw(); //cameraStage is drawn after stage so it will be over it!
...
Then you should add all listeners connected with camera gestures to cameraStage not stage but of course its functions should affect still actor stage.
Ok then you have two stages, the camera stage is over the stage with actors so you can touch wherever you want and you are sure you are touching both stages and what you have to do now is to set both stages as input processors actor stage as first and camera stage as second that you will be sure that event from actors stage are proceeded as first.
You will need InputMultiplexer to do this. The main scheme of code is:
InputMultiplexer inputMultiplexer = new InputMultiplexer();
inputMultiplexer.addProcessor(stage);
inputMultiplexer.addProcessor(cameraStage);
Gdx.input.setInputProcessor(inputMultiplexer);
Now your widgets events are handled as first.
If somethin won't work think also about removing cameraStage from inputMultiplexer when stade is touched down and adding it again when is touched up.
One simple advice also - especially when you are creating a tool that will be shared in the future use english variables/methods/etc names in the code - it will be more clear for other users