Quantcast
Channel: Question and Answer » libgdx
Viewing all articles
Browse latest Browse all 434

Libgdx detect touch on a specific object (while moving) [closed]

$
0
0

I have a class (I’ll call it with letter “A”) and class B.

A is the object (as a character) and B is the rendering class which have the aim to show A.

I am looking for a way to detect when A is pressed, with normal InputProcessor I can’t because it detect touch in the entire screen, I only want detect touch over the object. If I check touch position and “A” position it doesn’t work because the object is moving and the values aren’t so precise

How to solve?

this didn’t solve for me :Efficient way of detecting a touched object in a game?. Here is explained “what to do” and not “how to do”


Viewing all articles
Browse latest Browse all 434

Trending Articles