Jump to content


Photo

EXTENSION: iPhoneGM (iPhone accelerometer access)


  • Please log in to reply
18 replies to this topic

#1 aiacono

aiacono

    GMC Member

  • New Member
  • 13 posts

Posted 25 September 2011 - 11:36 PM

Hey guys,

Link to GEX: http://imkcreative.c...ml/iphonegm.gex

You can access the x, y, and z of the accelerometer using iphone_acceleration_x(), iphone_acceleration_y(), and iphone_acceleration_z()

Enjoy!
  • 0

#2 cotycrg

cotycrg

    GMC Member

  • GMC Member
  • 851 posts
  • Version:GM:Studio

Posted 26 September 2011 - 12:22 AM

Would this work on an Android device, as well? If not, it would be neat if you could make it do so!
  • 0

#3 Manuel777

Manuel777

    InvaderGames

  • GMC Member
  • 2859 posts
  • Version:GM:Studio

Posted 26 September 2011 - 10:16 AM

Would this work on an Android device, as well? If not, it would be neat if you could make it do so!

That ^
  • 0

#4 aiacono

aiacono

    GMC Member

  • New Member
  • 13 posts

Posted 26 September 2011 - 03:55 PM

Unless I'm wrong, I'm pretty sure the accelerometer for Android is not accessible in Javascript. I'm sure someone could work around it with an additional flash or Java applet on the webpage.
  • 0

#5 slam drago

slam drago

    The slam drag

  • New Member
  • 422 posts
  • Version:GM:Studio

Posted 26 September 2011 - 04:03 PM

Why not add the ability to get touches?
  • 0

#6 aiacono

aiacono

    GMC Member

  • New Member
  • 13 posts

Posted 26 September 2011 - 04:06 PM

Why not add the ability to get touches?


The only reason this extension was possible is the fact that window.ondevicemotion passes X, Y, and Z in event. I'm not sure what one would need to do for touch support.
  • 0

#7 Mark Overmars

Mark Overmars

    Game Maker Creator

  • YoYo Games Staff
  • 805 posts
  • Version:Unknown

Posted 26 September 2011 - 04:41 PM

Touch can simply be done using the mouse events. Or you can use the virtual keys.
  • 0

#8 aiacono

aiacono

    GMC Member

  • New Member
  • 13 posts

Posted 26 September 2011 - 05:20 PM

Touch can simply be done using the mouse events. Or you can use the virtual keys.


Ah, very cool.

By the way, is there a better place for me to be posting my extensions specifically for GML:HTML5?
  • 0

#9 cotycrg

cotycrg

    GMC Member

  • GMC Member
  • 851 posts
  • Version:GM:Studio

Posted 26 September 2011 - 06:26 PM

Touch can simply be done using the mouse events. Or you can use the virtual keys.

Yeah but that doesn't work with multitouch devices. Well it does, but with only the first touch. The 2nd-4th are completely ignored.
  • 0

#10 xot

xot

    media multimixer

  • Global Moderators
  • 4651 posts
  • Version:GM:Studio

Posted 26 September 2011 - 06:39 PM

Virtual keys map regions of the screen to key events. Any number of those can be fired at once -- multitouch. You might have to get creative to do multitouch swipes and pinches, but it's possible.
  • 0

#11 BlaXun

BlaXun

    Slime Online Creator

  • GMC Member
  • 2616 posts
  • Version:GM:Studio

Posted 26 September 2011 - 06:43 PM

Using a sprite as a collision box for touch would be nice, no?
  • 0

#12 connorcarpenter

connorcarpenter

    GMC Member

  • GMC Member
  • 6 posts

Posted 22 October 2011 - 07:41 PM

Actually, in my game there are virtual keys for moving and shooting - and what xot said doesn't seem to be the case - my character cannot register move and shoot commands at the same time.

Edited by connorcarpenter, 22 October 2011 - 07:41 PM.

  • 0

#13 XverhelstX

XverhelstX

    Xtremely Virtual St.

  • New Member
  • 521 posts
  • Version:Unknown

Posted 25 November 2011 - 09:06 PM

Just to let you know that I am making an extension where users will be able to access native Android stuff like GPS, accelerometer, bluetooth functions, screen device width etc
AND I am also looking for a way to publish an app to the Android Market that was build with GMHTML5.
I hope to get it released soon.

XverhelstX

EDIT:

Here's a small file that will show a toastmessage on your android device called from within GM:HTML5:

www.rootsoftllc.com/ShowToast.zip

It has a compiled .apk file included too, so you can try it out.
it has an object and when you press the object, a toastmessage appears.
I will try to add much more options if you guys are intrested.
In your gm:html5, you just call ShowToast("message")

Tomas

Edited by XverhelstX, 25 November 2011 - 10:21 PM.

  • 0

#14 policejohn99

policejohn99

    Fist Studios Owner

  • GMC Member
  • 88 posts
  • Version:GM8

Posted 01 December 2011 - 12:44 AM

Touch can simply be done using the mouse events. Or you can use the virtual keys.


HEY MARK IF YOU COULD GIVE ME SOME INFO HOW TO INSTALL THIS EXTENSION OR HOW TO USE IT AND IF YOU COULD SEND IT TO MY EMAIL MINERALPOLICEJOHN99@GMAIL.COM
  • 0

#15 imam_mashur

imam_mashur

    GMC Member

  • New Member
  • 282 posts

Posted 17 January 2012 - 09:11 AM

I don't know why but when i open the links..
I saw this..

���N��g������o���*0&o���5&.2 l�������r��� )���3&&506&!-0030..&3-(.&ݗ����������������j���}g��t���2*0&(.+���&:5&02*0&(.+b���t���2*0& 5����d���}g��t���2*0& 5t���2*0& 5t���������������g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���}g��G���2*0& &-&350 :G���2*0& &-&350 :t���������������g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���}g��G���2*0& &-&350 G���2*0& &-&350 t���������������g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���}g��G���2*0& &-&350 ;G���2*0& &-&350 ;t���������������g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g���g�������x���:]^SZzTw›N58~Rvl '4m@Q:@+g'bYcp[<KO!z(P]r=L!]^oeQ?<$}K%B8 3on§
m`I)&y"\͵瀻a[Q?


  • 0

#16 ipq

ipq

    GMC Member

  • GMC Member
  • 34 posts

Posted 18 January 2012 - 10:45 PM

@imam_mashur: Just point the link, right click and save the target file...
  • 0

#17 ionasskopelitis

ionasskopelitis

    GMC Member

  • GMC Member
  • 14 posts
  • Version:GM8

Posted 09 April 2012 - 06:05 PM

Unless I'm wrong, I'm pretty sure the accelerometer for Android is not accessible in Javascript. I'm sure someone could work around it with an additional flash or Java applet on the webpage.

dude android is written in java me myself know some java
  • 0

#18 Mirac7

Mirac7

    GMC Member

  • New Member
  • 37 posts
  • Version:GM:HTML5

Posted 17 April 2012 - 06:39 PM

Can somebody explain me how do I use these:

iphone_acceleration_x(),
iphone_acceleration_y(),
iphone_acceleration_z()

Cuz I am unable to write a single working line of code on my own...
Thanks
I need to move instance of an object left and right by tilting.
  • 0

#19 DefuzionGames

DefuzionGames

    GMC Member

  • GMC Member
  • 1417 posts
  • Version:Unknown

Posted 23 April 2012 - 12:13 PM

Just to let you know that I am making an extension where users will be able to access native Android stuff like GPS, accelerometer, bluetooth functions, screen device width etc
AND I am also looking for a way to publish an app to the Android Market that was build with GMHTML5.
I hope to get it released soon.

XverhelstX

EDIT:

Here's a small file that will show a toastmessage on your android device called from within GM:HTML5:

www.rootsoftllc.com/ShowToast.zip

It has a compiled .apk file included too, so you can try it out.
it has an object and when you press the object, a toastmessage appears.
I will try to add much more options if you guys are intrested.
In your gm:html5, you just call ShowToast("message")

Tomas


Yeah I had this problem too then i used this:
I found a way to easily convert your completed app so it is android market compatible

Click Here

Edited by DefuzionGames, 23 April 2012 - 01:06 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users