Tilt Issues
#1
Posted 23 May 2012 - 10:11 PM
I have been playing around with many of the new function as we all have I am sure, but have not been able to utilize the Tilt functions correctly yet... Of course it seems as simple as telling my object to set:
x += device_get_tiltx() //With proper syntax of course
...and to assume that I would be able to set my game into portrait (although that doesnt matter exactly yet) and tilt on the X-axis and watch my object follow accordingly. However it just sits there...lifeless.
I am running on a Droid X and have yet to test on another device...
Have you guys/girls had any luck with the Tilt functions yet? I suppose after this post I should get on Mantis and look into it, but seems the forums are the best source for help.
Thank you for your time & advice, and Game on.
#2
Posted 25 May 2012 - 03:15 AM
I used this as movement script:
x += device_get_tilt_y() * 20; y += device_get_tilt_x() * 20;
#3
Posted 25 May 2012 - 03:32 AM
#4
Posted 25 May 2012 - 06:24 PM
#5
Posted 09 June 2012 - 03:42 PM
I just tested it out on my Samsung Galaxy SII running Android 4.0.4 and the tilt functions seemed to work just fine.
I used this as movement script:x += device_get_tilt_y() * 20; y += device_get_tilt_x() * 20;
Thankyou ClassyGoat... this is what helped me on my S2 too.
Just one comment... the function you post here seems to be used for landscape right?
On my tests for Portait mode the x funcion would me like this:
x -= device_get_tilt_x() * 20;
Anyway... this is the best Tilt result I´ve got so far!
#6
Posted 11 June 2012 - 10:08 AM
draw_text(10, 10, 'X tilt: ' + string(device_get_tilt_x())) draw_text(10, 30, 'Y tilt: ' + string(device_get_tilt_y())) draw_text(10, 50, 'Z tilt: ' + string(device_get_tilt_z()))
#7
Posted 11 June 2012 - 06:20 PM
Do what I did, observe the results before actually using them!
draw_text(10, 10, 'X tilt: ' + string(device_get_tilt_x())) draw_text(10, 30, 'Y tilt: ' + string(device_get_tilt_y())) draw_text(10, 50, 'Z tilt: ' + string(device_get_tilt_z()))
where are you putting that? I tried on my Vibrant and it's not working.
#8
Posted 11 June 2012 - 09:54 PM
In the draw event, if you are using views, use this code instead:where are you putting that? I tried on my Vibrant and it's not working.
draw_text(view_xview[0] + 10, view_yview[0] + 10, 'X tilt: ' + string(device_get_tilt_x())) draw_text(view_xview[0] + 10, view_yview[0] + 30, 'Y tilt: ' + string(device_get_tilt_y())) draw_text(view_xview[0] + 10, view_yview[0] + 50, 'Z tilt: ' + string(device_get_tilt_z()))
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











