Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AGK and Android Tablet Input commands

Author
Message
bstebbs
11
Years of Service
User Offline
Joined: 10th Jan 2013
Location:
Posted: 4th Aug 2013 01:35
I am testing commands on my laptop and trying to run a test to have them work on my sons Android Tablet. Just trying to get the input devices to work so I can control sprites on my laptop (which I'm not having problems with) and the tablet (which for the life of me I CANNOT get it to work). I've tried the Accelerameter code, Virtual Joysticks, etc. and can't seem to get anything to work.

Can someone please help? All I want to do is have something work on the Android so that I can move a sprite accordingly. I'm thinking I've got a Tablet that won't recognize things but it recognizes tilting the tablet and it recognizes touch but doesn't seem to recognize ANYTHING I do via AGK.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th Aug 2013 10:04
which agk version you used?
do you tryed last beta too?
if you print the inputs on screen the tablet show allways 0?
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 4th Aug 2013 10:06 Edited at: 4th Aug 2013 14:29
Can you post some code for us to review? Here are some functions I used in one of my projects, which ran both on Windows and Android. It only a part, so it cannot be compiled, but it should give you an idea. Also, AppGameKit comes with a lot of pre-installed examples. It has several that deal with 'input'. You can find these in '[Drive]:\Program Files (x86)\The Game Creators\AGK\Projects\Basic\Examples'. You should be able to compile and broadcast them, to see if the methods used work on all your devices.

bstebbs
11
Years of Service
User Offline
Joined: 10th Jan 2013
Location:
Posted: 4th Aug 2013 17:38
I am using Build 107.

1) I tried adding a Virtual Joystick. It shows up great and works great on my laptop. Doesn't show up on the tablet. And oh, by the way, I downloaded AppGameKit for my Android phone, tested it, and that doesn't work either. Can't get it to pick up anything I test (F5).

//Virtual Joystick
AddVirtualJoystick(1,10,90,10)

2) Tried the Accelerometer code. Works fine on my laptop. Nothing on my Google Tablet and of course, my Android phone doesn't pick anything up.

x# = GetDirectionX ( )

SetSpritePosition ( 2, GetSpriteX ( 2 ) + x#, GetSpriteY ( 2 ))

3) Tried the GetPointerPressed command. Again, works on the laptop, not on the tablet.

if ( GetPointerPressed ( ) = 1 )
print("POINTER PRESSED")
xx# = GetPointerX ( )

SetSpritePosition(2, xx#, GetSpriteY(2))
endif
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 5th Aug 2013 08:16 Edited at: 5th Aug 2013 08:22
Hi bstebbs,

I suspect you might be using the latest stable release of AppGameKit (v1.076) with a newer beta-version of the Android player. Your tablet or phone might have updated the player in the background, leaving you with an incompatible setup. To fix this, you can download the latest beta-build of AppGameKit for Windows and install it on your laptop. Anything you compile and broadcast with this version should then work on your devices.

(You can find the beta-build by clicking on the buttons on the top-right of the site: [Home] -> [My account] -> [My products]. The beta-version of AppGameKit can be installed alongside version 1.076 if you have any qualms about using software that is still in development. Though the beta's have been very stable in my experience and add a tremendous amount of functionality).
bstebbs
11
Years of Service
User Offline
Joined: 10th Jan 2013
Location:
Posted: 19th Aug 2013 02:08
Zerotown...thanks so much. That worked. Great to see a game I'm working on in my tablet showing up on my Android phone. That's pretty cool. Of course, now I have to change some things as it's really small on my phone and the speed of the app is much faster on the phone, which won't work. And, I have to add in code to use touch commands on the phone so I can control things. But this is a great start. Thanks again.

Login to post a reply

Server time is: 2024-11-24 17:43:43
Your offset time is: 2024-11-24 17:43:43