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 / Positioning joystick buttons

Author
Message
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 2nd Dec 2011 01:33
Is there a way to do this? I can position the joystick itself easily enough, but am a little stuck when it comes to the button or buttons. I have tried SetVirtualButtonPosition but it seems that is only for buttons you create yourself rather than the ones for the joystick.
I could make buttons and drop the joystick button commands, but that would cause issues with people actually using a joystick. Am I missing something silly?

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 2nd Dec 2011 15:30
You can use the AGKButton commands to pick up joystick buttons and have them on screen when no joystick is connected.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 3rd Dec 2011 01:42
Can you elaborate on this? I see the GetVirtualButtonExists( index ) command, but as it needs an index to test against, and 1 to 12 do not seem to register, I am a still stuck. As I don't have a device to test on, I want to force the buttons on screen for me to setup as best I can, so when I get chance to test it will be more useful. Tests have worked pretty well, but the games were unplayable because of the buttons being offscreen or such.

Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 4th Dec 2011 09:17
You need to create the button in much the same way you did the joystick.

It often helps to see it in use so here's a quick demo;

This should help you get your head around it.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 4th Dec 2011 20:10
Thanks Marl, however, I am actually using the joystick commands rather than the virtual joystick ones. Basically, because it defaults to the virtual joystick on non joystick or keyboard enabled devices. I thought it ideal to use in general. However, the position of the buttons for that seem impossible to change. It does seem to take the point away from it reverting automatically, when you can't control how it looks afterwards.
I really think this should be looked at in future updates. A simple command to position your actual joystick buttons, would make things a lot better. The code Marl put up above for instance works fine, but only as a virtual joystick, not as a real one. Using the actual joystick commands gives you the ability to test with both a joystick, keys and the virtual joystick. With the obvious problem of screen placement I have mentioned.

Login to post a reply

Server time is: 2024-11-22 19:38:24
Your offset time is: 2024-11-22 19:38:24