No announcement yet.

[Solved] Scaleform Xbox360 Gamepad Problem

  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    I'm glad it helps you.

    If you want to use the ASCII values instead, here they are (if someone could add them to the documentation ) :

    Right Analog Stick Up : 112
    Right Analog Stick Down : 113
    Right Analog Stick Left : 114
    Right Analog Stick Right : 115

    Leave a comment:

  • replied
    Hey this is really cool! Thanks man Im gonna check this out and maybe use this.

    Leave a comment:

  • started a topic [Solved] Scaleform Xbox360 Gamepad Problem

    [Solved] Scaleform Xbox360 Gamepad Problem

    Hi everyone, I have problem with my Scaleform UI, i want to read the x and y values of the right stick of the Xbox 360 Gamepad but i can't have access to them, i've read the scaleform documentation but can't get it to work. There is a function called supportsAnalogEvents() which returns true if gamepad analog events are supported but it always returns false for me, you can find it here also tried the AddCaptureKey method doesn't work either.
    My as3 test code :
    import scaleform.gfx.Extensions;
    import scaleform.gfx.GamePad;
    import scaleform.gfx.GamePadAnalogEvent;
    Extensions.enabled = true;
    trace("Gamepad analog support : ",GamePad.supportsAnalogEvents());
    function GamepadHandler(e:GamePadAnalogEvent):void{
    	trace("x_value : ",e.xvalue,"y_value :",e.yvalue);

    I finally found a way to get the x and y values of the right stick in my ActionScript code. Since Scaleform GamePadAnalogEvents won't work, I get the right stick values from an Unrealscript function that I call in my Actionscript code. It's seems that we can't directly access those values from ActionScript so the only way i found is to get them from the playerInput class, and then put them into ActionScript variables.

    Example :

    class MyGfxClass extends GFxMoviePlayer;
    function getRStickValues(GFxObject MyMC)
        local vector2D RStick;
        RStick.x = GetPC().PlayerInput.RawJoyLookRight; // X Value [-1;1]
        RStick.y = GetPC().PlayerInput.RawJoyLookUp; // Y Value [-1;1]
    import flash.external.ExternalInterface;
    var R_StickX:Number;
    var R_StickY:Number;
    function setRStickValues():void{"getRStickValues",this);