I want to display accelerometer angle in a text box

bajashbajash Member, PRO Posts: 215
edited February 2012 in Working with GS (Mac)
Hi All.

I set up my accelerometer on my game. I want to be able to show the angle (coordinates) I am tilting at. Can anyone let me know how I st this up?

Thanks in advance.

Comments

  • App SurgeApp Surge Member Posts: 651
    In an actor, drag in the display text behavior and click the e on the right. then navigate to devices - accelerometer- (x, y, or z. Whichever one you want to display.) Then add it to the scene and voila!
  • old_kipperold_kipper Member Posts: 1,420
    edited February 2012
    display text. vectorToAngle( game.Accelerometer.X , game.Accelerometer.Y )+180

    hope that helps. kipper

    edit redsky beat me to it... just couldn't remember quite the bit about the adding of 180 so checked it. otherwise you go negative
  • bajashbajash Member, PRO Posts: 215
    @Redsky, I did that before I even posted this question. Try it, does not work.

    @ old_kipper - This did not work either.
  • old_kipperold_kipper Member Posts: 1,420
    not sure what your doing but I can send you a file of it working. pm me your email and I will send it over.
  • bajashbajash Member, PRO Posts: 215
    OK
  • old_kipperold_kipper Member Posts: 1,420
    file sent
  • bajashbajash Member, PRO Posts: 215
    Old_Kipper,

    Yours does work. Thanks.
    It just stays at 180°. Do I have to load app to my device to see if it works?

    Thanks.
  • old_kipperold_kipper Member Posts: 1,420
    You do have to load it onto device for it to give you a readout other than 0 (or as I have added 180 to the expression- 180). It works in the on device viewer or if you do an adhoc build. cheers kipper
Sign In or Register to comment.