FoxyOfJungle
Kazan Games
Hello!
So, I have a virtual joystick, but it only detects the click if the "device" is 0.
If I use a
1 - This works:
2 - This doesn't works:
Notice in example 1 that I put 1 in the loop, using only device 0.
What am I doing wrong? Theoretically it should work...
Can anyone help? Thank you!
So, I have a virtual joystick, but it only detects the click if the "device" is 0.
If I use a
for
loop, it doesn't recognize any clicks...1 - This works:
GML:
for (var i = 0; i < 1; ++i) {
if device_mouse_check_button(i, mb_left) {
if point_in_circle(device_mouse_x_to_gui(i), device_mouse_y_to_gui(i), x, y, r) {
ii.js_active = true;
}
} else {
ii.js_active = false;
}
}
2 - This doesn't works:
GML:
for (var i = 0; i < 4; ++i) {
if device_mouse_check_button(i, mb_left) {
if point_in_circle(device_mouse_x_to_gui(i), device_mouse_y_to_gui(i), x, y, r) {
ii.js_active = true;
}
} else {
ii.js_active = false;
}
}
Notice in example 1 that I put 1 in the loop, using only device 0.
What am I doing wrong? Theoretically it should work...
Can anyone help? Thank you!