protected override void InitialisePlayerInput(Xen.Input.PlayerInputCollection playerInput) { //setup text //generate a string to indicate the buttons to hold to adjust the effects string button1, button2, button3; if (playerInput[PlayerIndex.One].ControlInput == Xen.Input.ControlInput.KeyboardMouse) { button1 = playerInput[PlayerIndex.One].KeyboardMouseControlMapping.A.ToString(); button2 = playerInput[PlayerIndex.One].KeyboardMouseControlMapping.B.ToString(); button3 = playerInput[PlayerIndex.One].KeyboardMouseControlMapping.X.ToString(); playerInput[PlayerIndex.One].InputMapper.CentreMouseToWindow = true; } else { button1 = "A"; button2 = "B"; button3 = "X"; } text.Text.Clear(); text.Text.AppendFormatLine("Hold '{0}' to fire particle bursts", button1); text.Text.AppendFormatLine("Hold '{0}' to disable back to front draw sorting", button2); text.Text.AppendFormatLine("Hold '{0}' to show the Cull Tests performed", button3); }
protected override void InitialisePlayerInput(Xen.Input.PlayerInputCollection playerInput) { if (playerInput[PlayerIndex.One].ControlInput == Xen.Input.ControlInput.KeyboardMouse) { playerInput[PlayerIndex.One].InputMapper.CentreMouseToWindow = true; } }
//NEW CODE //Finally, the method 'InitialisePlayerInput' can be overridden to change //player input settings when the application starts up. //This method is called right after Initialise protected override void InitialisePlayerInput(Xen.Input.PlayerInputCollection playerInput) { //if using the mouse, then make it centre to the window if (playerInput[PlayerIndex.One].ControlInput == Xen.Input.ControlInput.KeyboardMouse) { playerInput[PlayerIndex.One].InputMapper.CentreMouseToWindow = true; } }
protected override void InitialisePlayerInput(Xen.Input.PlayerInputCollection playerInput) { //generate a string to indicate the button to hold to pause culling if (playerInput[PlayerIndex.One].ControlInput == Xen.Input.ControlInput.KeyboardMouse) { cullButtonText = playerInput[PlayerIndex.One].KeyboardMouseControlMapping.A.ToString(); playerInput[PlayerIndex.One].InputMapper.CentreMouseToWindow = true; } else { cullButtonText = "A"; } cullButtonText = string.Format("Hold '{0}' to pause culling", cullButtonText); }
protected override void InitialisePlayerInput(Xen.Input.PlayerInputCollection playerInput) { this.yellowElement.Text.AppendLine(); //if using keyboard/mouse, then centre the mouse each frame if (playerInput[PlayerIndex.One].ControlInput == Xen.Input.ControlInput.KeyboardMouse) { playerInput[PlayerIndex.One].InputMapper.CentreMouseToWindow = true; this.yellowElement.Text.AppendLine("Use the mouse and WASD to move the camera"); } else { this.yellowElement.Text.AppendLine("Use the gamepad to move the camera"); } }
protected override void InitialisePlayerInput(Xen.Input.PlayerInputCollection playerInput) { //setup text //generate a string to indicate the buttons to hold to adjust the animation string button1, button2; if (playerInput[PlayerIndex.One].ControlInput == Xen.Input.ControlInput.KeyboardMouse) { button1 = playerInput[PlayerIndex.One].KeyboardMouseControlMapping.A.ToString(); button2 = playerInput[PlayerIndex.One].KeyboardMouseControlMapping.B.ToString(); } else { button1 = "A"; button2 = "B"; } text.Text.Clear(); text.Text.AppendFormatLine("Hold '{0}' to spin Tiny's upper body", button1); text.Text.AppendFormatLine("Hold '{0}' and Tiny will have an unfortunate accident", button2); }
/// <summary> /// Override this method to modify the setup of the player input objects before the application starts /// </summary> /// <param name="playerInput"></param> protected internal virtual void InitialisePlayerInput(Xen.Input.PlayerInputCollection playerInput) { }
protected override void InitialisePlayerInput(Xen.Input.PlayerInputCollection playerInput) { //setup so pressing Enter is the same as 'A', for interaction with the options menu playerInput[0].KeyboardMouseControlMapping.A = Microsoft.Xna.Framework.Input.Keys.Enter; }