- Home /
best way to handle input on a 2D map button
Hello, i have a Button inside a canvas with onclick now i want to divide the button into 100 areas write the area positions to a dictionary and determine which area was clicked. how can i get the position which was clicked on the button and access the right key in the dictionary?
Note i use the button as a map so i zoom and move my main camera on it.
Answer by alankemp · Feb 11, 2016 at 11:46 PM
See this answer:
http://answers.unity3d.com/questions/892333/find-xy-cordinates-of-click-on-uiimage-new-gui-sys.html
I tried this but it does only work when the item is not scaled.
ah i did just find the solution by multiplicating it by the scale.
Your answer
Follow this Question
Related Questions
How do I make my player jump on click on the button? 3 Answers
How to use Button as Cross Platform Input 0 Answers
Detection of device fall 0 Answers
Mouse and Oculus Touch Controller Inputs 0 Answers
Why is the keypress only registered on the second press? 3 Answers