I'm implementing viewport resizing in order for my game to maintain the same display ratio on all devices.
However, I've found an issue with getting touch events.
Basically, if my viewport, for example, uses the whole of the physical screen's width and height then there is no issue. However, if it is resized say in the vertical, then my touch events are thrown off, because touch events are registered from the top of the physical screen. Hence if I put a sprite at say position 50 in the Y direction then it put's the sprite 50 pixels down from the top of the viewport, not the top of the actual screen.
Do I have to manage this myself by adding my viewport's offset to my touch events or is there a way to tell Android to register 0, as the top of the viewport as opposed to the actual screen.
Here is a graphic to illistrate what I mean, any help would be appreciated