0
\$\begingroup\$

I created a game and would like to test it on android, but it does not respond to any touch on the screen, I think it's because I have to adapt the game code for android. Click => Touch

I developed it and tested it with the selected target (windows):

enter image description here

I was able to put it to run on an android virtual machine, but it does not respond to any commands:

enter image description here

How could he do that?

How to adapt the function => if (point_in_rectangle(window_mouse_get_x(),window_mouse_get_y(),60,250,104,313)) && config==false for example? For something that works for android.

I hope I have been clear. What I want exactly is to turn all game mouse clicks into screen touches.

Sorry for any translation error and thank you already

\$\endgroup\$
  • 1
    \$\begingroup\$ I did a google translate on it; looks pretty simple. \$\endgroup\$ – Almo Jul 7 '17 at 15:17
  • \$\begingroup\$ Yes, not only the problem, but the game is also simple. But none of the buttons work, do not leave this screen. \$\endgroup\$ – Boneco Sinforoso Jul 7 '17 at 23:10
  • \$\begingroup\$ Draw rectangles you checking, like draw_rectangle(60,250,104,313,true); so you'll be able to see where it is actually at the screen. The problem depends on lot of things, like is there used scaling (and what way used for this), how you define objects' positions, etc. \$\endgroup\$ – Dmi7ry Jul 8 '17 at 7:42
  • \$\begingroup\$ Even though this is just a click function? \$\endgroup\$ – Boneco Sinforoso Jul 8 '17 at 21:15
1
\$\begingroup\$

I found the solution. The code I posted in the question works for the application on windows, to make it work for android is just modifying it as follows:

if (point_in_rectangle(window_mouse_get_x(),window_mouse_get_y(),60,250,104,313)) && config==false <= becomes => if device_mouse_x(0)>=60 && device_mouse_y(0)>=250 && device_mouse_x(0)<=104 && device_mouse_y(0)<=313{

Link => https://docs.yoyogames.com/source/dadiospice/002_reference/mouse,%20keyboard%20and%20other%20controls/device%20input/index.html

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.