I’m starting to use SteamInput to navigate my menu system now. I have an idea of what I want to do, but I wanted to try to understand the GFxUDKFrontEnd system first. How does changing focus work using a controller in GFxUDKFrontEnd? I think it interprets controller inputs as keyboard inputs. That’s not going to work for me because I want SteamInput, and not the GFxMoviePlayer, to capture controller input. But I’d still like to know how it works so I can recreate the same effect using SteamInput.
So first off, how does GFxUDKFrontEnd change focus from one UIComponent to another? I think these are the most important functions.
MenuManager.as
public function setSelectionFocus(mc:MovieClip):Void {
Selection.setFocus(mc);
}
function handleInput(details:InputDetails, pathToFocus:Array):Boolean {
var nextItem:MovieClip = MovieClip(pathToFocus.shift());
var handled:Boolean = nextItem.handleInput(details, pathToFocus);
if (handled) { return true; }
// Maps Escape-KeyUp to _global.OnEscapeKeyPress(), a function object defined in UnrealScript
// and set by each view which calls some method. Generally this pops a view from the view stack.
if (details.navEquivalent == NavigationCode.ESCAPE && details.value == "keyUp") {
_global.OnEscapeKeyPress();
return true;
}
return false; // or true if handled
}
View.as
function handleInput(details:InputDetails, pathToFocus:Array):Boolean {
var nextItem:MovieClip = MovieClip(pathToFocus.shift());
var handled:Boolean = nextItem.handleInput(details, pathToFocus);
if (handled) { return true; }
return false; // or true if handled
}
Can someone tell me what calls handleInput? Where does pathToFocus come from?