0

I have a tiled map on my libGDX project where I can move it using the keys on my keyboard. I have set up boundaries so it doesn't go outside the tiled map. In my tiled map I have three layers a background layer and two other layers for the pictures of my shop. I am wonder how I would be able to click on the shops so it brings on a menu. The only problem I have is they move! Is there a simple way to do this? You may have to dumb it down for me because I am new at coding in java/libGDX!

Here is my code for detecting the touch currently but I know this will get messed up once I move my camera.

    if (touch.x <= 1300 && touch.x >= 700 && touch.y <= 700 && touch.y >= 0){
            weapons_menu.setVisible(true);
            move_camera = false;
        }

Thanks,

Nehemiah

1 Answers1

0

maybe this can help you:

LibGDX: How to make tiled map tiles clickable?

or this:

https://stackoverflow.com/search?q=%5Blibgdx%5D+tiled+maps+click

Community
  • 1
  • 1
Angel Angel
  • 19,670
  • 29
  • 79
  • 105