Announcement

Collapse
No announcement yet.

Touch Data lost in the menu scene!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Touch Data lost in the menu scene!!

    Hi all,

    I'm trying to retain touch data between a MobileMenuScene that takes up only a part of the screen, and the MobilePlayerInput class. However, according to my log files....the MPI no longer retains the touch data when the player touches the menu scene!!

    I need to be able to continuously register the touch data into the Touches array inside of the MPI class. How can I do this? Why does touching a menu scene disrupt the flow of touch data? I don't understand.

    If anyone can provide information on the matter it would be greatly appreciated!


    The log file script placement I did to find out what was happening:
    Code:
    class CustomPlayerController extends SimplePC;
    
    event InitInputSystem()
    {
    ........
            //Get a reference to the local MobilePlayerInput
    	MPI = MobilePlayerInput(PlayerInput);
    
    	//Asking the input handler function to the delegate
    	MPI.OnInputTouch = HandleInputTouch;
    .......
    }
    
    function HandleInputTouch(int Handle, ETouchType Type, Vector2D TouchLocation, float DeviceTimestamp, int TouchpadIndex)
    {
    ........
       For(i=0; i<MPI.NumTouchDataEntries; i++)
       {
       	`log("PLAYER CONTROLLER.......Touch Handle: "$MPI.Touches[i].Handle$", bInUse: "$MPI.Touches[i].bInUse$", State: "$MPI.Touches[i].State);
       }
    ......
    }
    Code:
    class CustomMobileMenuScene extends MobileMenuScene;
    
    function bool OnSceneTouch(ETouchType EventType, float TouchX, float TouchY, bool bInside)
    {
    .......
       local int i;
       local MobileMenuObject Touchable;
       
       For(i=0; i<InputOwner.NumTouchDataEntries; i++)
       {
       	`log("MENU SCENE.......Touch Handle: "$InputOwner.Touches[i].Handle$", bInUse: "$InputOwner.Touches[i].bInUse$", State: "$InputOwner.Touches[i].State);
       }
       
       if(TouchY < MenuTop || TouchY > MenuBot || TouchX < MenuLeft || TouchX > MenuRight)
       {
       	   if(EventType == Touch_Began || !bSwipe)
       	   	   return false;
       }
    .......
    }

    #2
    I have found this delegate inside of the MPI class. Problem is it does not retain or passover any of the touch input data as there are no parameters passed to the delegate.
    Code:
    class MobilePlayerInput extends PlayerInput within GamePlayerController
    	native
    	DependsOn(MobileInputZone)
    	config(Game);
    
    /**
     * Invoked when the mobile menus did not process an Touch_Began.
     */
    delegate OnTouchNotHandledInMenu();
    ...Unless I am missing something here, this function doesn't help my case too much as I need to track the in-process touch.

    Any ideas on how to pass over the touch input from menu scene to Mobile Player Input..?

    ***EDIT***
    ...This function did not work as expected....it is only fired when a touch does NOT touch my menu scene...hmm...

    Comment


      #3
      I have further discovered that it is the MobileMenuObjects "blocking" the flow of touch data to the touches array...

      Comment

      Working...
      X