Announcement

Collapse
No announcement yet.

Creating a Mouse Cursor in the HUD

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

  • replied
    Well, I've given you everything I know to give. You're going to have to go over your code and Flash file and look for errors.

    Leave a comment:


  • replied
    I've got mouse cursor set up the way you did it in first post. I've got an actionscript ShowCursor function, that shoots an external interface of ignoremouse, set the way you said here before. I've got that FilterButtonInput in place, too. In Kismet, I call ShowCursor function when the movie is loaded, and when trigger is touched. Yet, it still doesn't work - after game start the cursor appears in top right corner and wouldn't move.
    I was wondering... Is there a way of disabling mouse capturing in every scaleform movie inside a level, if it's not in focus?

    Leave a comment:


  • replied
    I've got an 'Object keycode has no handler for GFxAction_Invoke_0', even though everything is correct.
    I'm not sure why, but I'm still failing at making it work. ;P I guess I need to rework it from the ground.

    Leave a comment:


  • replied
    Ok, in May, bCaptureInput is not available; however, you can use SetFocus(bool, bool)

    http://files.arbi.trari.us/Doc/gfxui...tml#_SetFocus-

    So, to tell your movie to capture or not capture input, try this:

    Code:
    function IgnoreMouse(bool toggle)
    {
        SetFocus(toggle, toggle);
        bNoMouse = toggle;
    }
    And - be sure to use the FilterButtonInput() function I gave you above as well.

    Leave a comment:


  • replied
    Give me a little time, and I'll get back to you. Hopefully today. I'm downloading May 2010 now.

    Leave a comment:


  • replied
    I'd be grateful. I'm not sure if I'll be able to convert everything to newer UDK version.

    Leave a comment:


  • replied
    The code looks fine. I have no idea why bIgnoreMouseInput is giving you an error. Maybe it wasn't implemented in May 2010 UDK? I"m working in February 2011. I'll have to do some research on the May version.

    Leave a comment:


  • replied
    May 2010 version.

    Leave a comment:


  • replied
    What version of UDK are you using?

    Leave a comment:


  • replied
    Code:
    /**
     * Shows Interaction options to the User; One can define upto six selectable options for the Interaction
     */
    class GFxUI_Keycode extends GFxMoviePlayer;
    
    var GFxObject MyContainer;
    
    var int MouseX;
    var int MouseY;
    
    function bool Start(optional bool StartPaused=false)
    {
            super.Start();
    	// Start at the first frame
    	Advance(0.f);  
    	// Flush PlayerInput and stop the Pawn
    	PlayerOwner.PlayerInput.ResetInput();
    	PlayerOwner.Pawn.ZeroMovementVariables();
    	`log("Start the keycode movie, hell yeah");
    	return true;
    }
    
    // This is called from Flash.
    function ReceiveMouseCoords( float x, float y )
    {
    	MouseX = x;
    	MouseY = y;
    }
    function RightCode()
    {
             `log("###### ExternalInterface Call Received #####");
        TriggerRemoteKismetEvent('MyEvent');
    }
    
    //function to trigger a remote kismet event
    function TriggerRemoteKismetEvent( name EventName )
    {
        local array<SequenceObject> AllSeqEvents;
        local Sequence GameSeq;
        local MyPlayerController PC;
        local int i;
        PC = MyPlayerController(PlayerOwner);
        GameSeq = PC.WorldInfo.GetGameSequence();
        if (GameSeq != None)
        {
            // find any Level Reset events that exist
            GameSeq.FindSeqObjectsByClass(class'SeqEvent_RemoteEvent', true, AllSeqEvents);
    
            // activate them
            for (i = 0; i < AllSeqEvents.Length; i++)
            {
    	    if(SeqEvent_RemoteEvent(AllSeqEvents[i]).EventName == EventName)
    	    SeqEvent_RemoteEvent(AllSeqEvents[i]).CheckActivate(PC.WorldInfo, None);
    	}
        }
    }
    function IgnoreMouse(bool toggle)
    {
        self.bIgnoreMouseInput = toggle;
    }
    DefaultProperties
    {
    //	bGammaCorrection=false // Remove this line for UDK June version onwards
            bIgnoreMouseInput = false;
    	MovieInfo=SwfMovie'GFx_Interaction.keycode'
    }
    UnrealScript.
    Code:
    var number:String = "";
    var index:Number = 0;
    /* when a key is pressed, execute this function. */
    runfunction();
    function runfunction()
    {
    	if(myCursor._disabled==false)
    	{
    	//ShowCursor(MyBool);
    	trace(myCursor._disabled);
    	B1.onRelease = function()
    	{
    		number = number + "1";
    		keycode.text = number;
    	}
    	B2.onRelease = function()
    	{
    		number = number + "2";
    		keycode.text = number;
    	}
    	B3.onRelease = function()
    	{
    		number = number + "3";
    		keycode.text = number;
    	}
    	B4.onRelease = function()
    	{
    		number = number + "4";
    		keycode.text = number;
    	}
    	B5.onRelease = function()
    	{
    		number = number + "5";
    		keycode.text = number;
    	}
    	B6.onRelease = function()
    	{
    		number = number + "6";
    		keycode.text = number;
    	}
    	B7.onRelease = function()
    	{
    		number = number + "7";
    		keycode.text = number;
    	}
    	B8.onRelease = function()
    	{
    		number = number + "8";
    		keycode.text = number;
    	}
    	B9.onRelease = function()
    	{	
    		number = number + "9";
    		keycode.text = number;
    	}
    	B0.onRelease = function()
    	{	
    		number = number + "0";
    		keycode.text = number;
    	}
    	BCE.onRelease = function()
    	{
    		number = number.substr(0,number.length-1);
    		keycode.text = number;
    	}
    	ButtonPush.onRelease = function()
    	{
    		if(number != "1337151337")
    		{
    			number = "";
    			keycode.text = number;
    		}
    		else
    		{
    			import flash.external.ExternalInterface;
    		    ExternalInterface.call("RightCode");
    		}
    	}
    }
    }
    ActionScript, main part.
    Code:
    import gfx.controls.Cursor;
    import flash.external.ExternalInterface;
    
    var myCursor = new Cursor("cursorMC");  
    myCursor.enable();
    function ShowCursor(MyBool:Boolean)
    {
    	if(MyBool==true)
    	{
    		myCursor.enable();
    		ExternalInterface.call("IgnoreMouse", true);
    	}
    	else
    	{
    		myCursor.disable();
    		ExternalInterface.call("IgnoreMouse", true);
    	}
    }
    ActionScript, cursor layer.
    And mousecursor class

    Leave a comment:


  • replied
    Can you show me your exact code?

    Leave a comment:


  • replied
    GFxUI_keycode class, extending GFxMoviePlayer. It's right at the end of the file, just before defaultproperties.

    Leave a comment:


  • replied
    Where did you put bIgnoreMousInput? What class? What does that class extend?

    Leave a comment:


  • replied
    I've got an error: 'Unrecognized member 'bIgnoreMouseInput' in class <GFxUI_Keycode>'

    Leave a comment:


  • replied
    Unreal intercepts all input. Handling it is usually done with binding in DefaultInput.ini

    When you have a GFx Movie Player being shown though, you can tell it to intercept input.

    Leave a comment:

Working...
X