Look at Informatix's "Map tIDE" example in his example suite to see how to set up the lgGestureDector and apply that to your app. Then, in the GD_Touchdown event you can translate the touch to your grid co-ordinates using your Stage.ScreenToStageCoordinates method. Something like:
B4X:
Sub GD_TouchDown(X AsFloat, Y AsFloat, Pointer AsInt) As Boolean
Dim poVect As lgMathVector2
' calculate where we touched
poVect.X = X
poVect.Y = Y
poVect = MainStage.ScreenToStageCoordinates(poVect)
Dim piX As Int = FromPixelToTile_X(poVect.X)
Dim piY As Int = FromPixelToTile_Y(poVect.Y)
LogColor("GD TOUCH Map Pos: " & piX & ", " & piY, Colors.Magenta)
Return False
End Sub
If you are unfamiliar with the "FromPixel..." methods please see Informatix's PacDroid example.
Sub GD_TouchDown(X AsFloat, Y AsFloat, Pointer AsInt) As BooleanDim poVect AslgMathVector2
' calculate where we touched poVect.X = X
poVect.Y = Y
poVect = MainStage.ScreenToStageCoordinates(poVect)Dim piX As Int = FromPixelToTile_X(poVect.X)Dim piY As Int = FromPixelToTile_Y(poVect.Y)
LogColor("GD TOUCH Map Pos: " & piX & ", " & piY, Colors.Magenta)
ReturnFalseEnd Sub
Correct, but it does have a gesture detector and it shows you how to initialize it. You can add additional events for the detector to handle touches (this example) or panning, zooming, etc.
I'm not sure if a stage is required, I just use one to make things easier as it has its own viewport, spritebatch and camera objects.
MainStage is just a lgScn2DStage object. As for the "FromPixel..." methods, I already told you to take a look at Informatix's PacDroid example (click the word "PacDorid" in post #2). His PacDroid tutorial has a perfect example of those methods and he explains them very well too, if I recall correctly.
Giving any type of "complete and running code" for LibGDX is usually very problematic due to how the interface works. You really are much better off going through the examples Informatix has created and then combining the parts you need from his various example programs. To understand the examples, take the time to read through his LibGDX Tutorial it really does a good job of explaining the fundamentals.
Now, knowing which items you need to use when, that I am afraid I am still discovering myself