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 / Virtual button issues

Author
Message
gbison
13
Years of Service
User Offline
Joined: 15th Dec 2010
Location: USA
Posted: 17th Nov 2012 06:12
Evening all,

We were using the virtual button options in our latest development as placeholders until the art comes in. The problem is we are getting the appearance of a rogue button when testing on the Android.

To explain a bit further, we created 3 virtual buttons to use as place holders for the main menu load. Everything looks perfect on the PC while development is happening. When deploying to the actual devices (Android) we are getting the immediate apperance of a virtual button we did not create and that is much larger than anything we created. It would appear, AppGameKit itself for some reason is putting this button in here by default when viewing on the actual mobile device, any idea how and why? Further more, how do we stop it?

Thanks in advance...

"The greatest trick the devil ever pulled, was to convince the world he didn't exist."
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 17th Nov 2012 15:01
I think, if you use the joystick commands rather than the virtual joystick this can happen. It has been awhile since I last did much joystick related code, but remember having to reposition and resize the buttons myself on a few projects.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 17th Nov 2012 17:16
gbison, I would say that we need a bit more information.

For starters, what version of AppGameKit are you using, v1076 or v1083?

And are you working in Tier 1 or Tier 2?

What Android version are you testing on?

And samples of the code you use to put the buttons up would help as well.

I use hidden virtual buttons for many things throughout my app and have had no problems in any of the platforms (Windows, Mac, iOS and Android).

Cheers,
Ancient Lady
AGK Community Tester
gbison
13
Years of Service
User Offline
Joined: 15th Dec 2010
Location: USA
Posted: 17th Nov 2012 18:55 Edited at: 17th Nov 2012 19:38
@Ancient Lady

1083, Tier 1, Android 4 ICS




@Dvader
The only input methods we are working with are that of the virtual joystick and the virtual button. So i wouldn't think this should be an issue but I'm not sure.

Despite our best efforts we cannot understand whats causing this and it only shows up once we deploy to the device itself and its always in the lower right hand corner of the screen.


***UPDATE***
We just figured out the problem. Apparently buttons have to be made in order. So if it does not see a virtual button with an ID of 1 it will add one for you automatically. Either I looked over it or I didn't see anywhere in the API that stated this?

None the less problem solved simply by making sure the first VB id is in use. We had originally skipped these spots which were to be held by buttons that would have been activated further on in the program.

"The greatest trick the devil ever pulled, was to convince the world he didn't exist."
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 17th Nov 2012 21:12
Quote: "it will add one for you automatically"

Really?!?

I haven't had that problem in v1076. This must be something introduced in v1083.

Please post this in the Google Issue list.

A simple test app can be built with just your code snippet a couple of tests (checking for button presses). Testing in both v1076 and v1083 should be easy.

I'm frantically working on the levels for my app so that I can get it published, otherwise I'd try the tests today.

Cheers,
Ancient Lady
AGK Community Tester
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 17th Nov 2012 21:39
Okay, I couldn't not try it myself.

I created the following code:


When run in Windows, both v1076 and v1083 showed that only virtual buttons 3, 4 and 5 existed.

Then I broadcast to the appropriate Player (the v1076 self-built, the v1083 from the TGC My Products page).

It worked the same as in Windows for both versions. So, I cannot confirm this as an AppGameKit issue for v1083. The short snippet works okay.

Might there be somewhere else in your code that is possibly creating the phantom button?

Cheers,
Ancient Lady
AGK Community Tester
gbison
13
Years of Service
User Offline
Joined: 15th Dec 2010
Location: USA
Posted: 18th Nov 2012 07:24 Edited at: 18th Nov 2012 07:28
Quote: "Might there be somewhere else in your code that is possibly creating the phantom button?"


Unfortunately not. As I mentioned before, everything was perfect on the PC on two different rigs. I cannot attest to anything prior to 1083 really , as we only adopted the language recently to handle our mobile work. After further reading AppGameKit apparently try's to make sure all platforms have a button, if a keyboard and joystick are not found then a virtual button is produced.

We had not used numbers 1 and 2 as we had then reserved for future buttons that were to be activated later on. So only 3, 4 and 5 were being created at run-time. As soon as we reversed the it and changed 3,4 and 5 to 1,2 and 3....it was instantly fixed. No big deal though, we are only using them for placeholders and have our own GUI builds to port over... Above and beyond this if I come across anything else Ill be sure to update you.

"The greatest trick the devil ever pulled, was to convince the world he didn't exist."
TheTeenDevs
11
Years of Service
User Offline
Joined: 19th Aug 2012
Location:
Posted: 25th Dec 2012 03:31 Edited at: 25th Dec 2012 03:32
I don't know how appropriate this is for this post but..... ahs Anyone have any luck on android tier2 virtual joystick? When I put this in:
agk::AddVirtualJoystick(UNIT 2,float 90,float 90,float 10);
it gives me a syntax error.... I think is has something to do with the UNIT........I don't know what that is
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Jan 2013 16:30

You are including the type descriptors in the call and that is not correct. When you look at the help pages, they are showing you the type for each variable to pass. You do not include that type in the call. When it calls for a 'float' variable, make sure to pass in a value like '90.0' and not '90' (without the quotes). In C++ it will interpret '90' as an integer and will complain with a warning.

And, 'UNIT' is actually 'UINT'. 'UINT' stands for 'unsigned integer.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-04 01:02:45
Your offset time is: 2024-05-04 01:02:45