4 Replies Latest reply: Jul 3, 2013 7:22 PM by MJD1981 RSS

    GameInput APIs in Adobe AIR 3.7

    nimitja Employee Hosts

      The GameInput API is an interface that allows applications to communicate with attached game input devices (joysticks, gamepads, wands, etc). This API is only supported on Android devices running on OS version 4.1 or higher. This feature can only be used with namespace 3.7 or greater and requires the minimum swf version to be equal or greater than 20.

       

      For more details on GameInput APIs please refer: http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/ui/GameInput .html


      GameInput APIs do not provide mapping between physical controls (for example, a button) and their logical counterparts (for example, DPAD right button or left trigger). There is a need for a higher level controls that makes common actions easier for the game developer. So, GameInput SWC is introduced and is designed such that it’s easier for the game developers to write games which use gamepads or such devices and minimum possible change is required to make an existing game work with a new input device.

       

      You can download the GameInput SWC from https://www.dropbox.com/s/yfrsj8gdvcdg1bw/gameinputcontrolname.swc

      For more details on GameInput SWC please refer: https://www.dropbox.com/s/wf67l9t3kkack7z/GameInputControlNameASDoc.zip

       

       

      GameInput.png

       

      -Nimit

      Adobe AIR Team

        • 1. Re: GameInput APIs in Adobe AIR 3.7
          Neverbirth Community Member

          Just curious, will you release the SWC source code?

           

          Thanks for you work.

          • 2. Re: GameInput APIs in Adobe AIR 3.7
            MJD1981 Community Member

            Has anybody successfully implemented this yet?

             

            Despite including the SWC provided, I'm getting "Class flash.ui::GameInput could not be found" on AIR 3.8.

             

            Was I naive to think I could test this on Windows? Although I don't yet own an OUYA, I was hoping to get some response from an Xbox controller.

            • 3. Re: GameInput APIs in Adobe AIR 3.7
              zeh Community Member

              Thanks for this, guys. Will GameInput be available for other profiles in the future? Especially desktop and iOS (now that iOS is adding gamepad support). The documentation doesn't even list this limitation (although the tutorial does).

               

              @MJD1981: it's working well when testing from an OUYA. When testing on a PC, it wouldn't work (GameInput.isSupported is false), but it should definitely be available as a class. The error you're seeing indicates it's not being imported at all. You're probably using the wrong airglobal.swc. I know it sounds crazy, but 3.8 is a beta, so not sure it actually contains all changes that have been applied to 3.7. Have you tried with the stable Air SDK?

              • 4. Re: GameInput APIs in Adobe AIR 3.7
                MJD1981 Community Member

                I did manage to get it to work in the end, thanks - even at the desktop! Turns out I was calling the imports a little bit too late in my large project, so I made it more of a priority.