Problem with gamepad and control focus
Posted: 20 Aug 2019, 12:49
Hi,
I have a very basic placeholder pause menu for the game I am developing. The layout code looks like this:
Previously, I had only the resume and exit buttons, ie. the load button did not exist. The gamepad input worked pretty well. I set the focus on the resume button when the pause menu appears and the user was able to move between the buttons with the gamepad D-pad. However, if the user pressed up when the focus was on the resume button the focus moved off the buttons completely. Perhaps it focused the textblock above them or something? This is my first issue, how to I restrict the focus to move only between the buttons when using gamepad input?
My second issue started occuring when I added the load button between the other two buttons. Now when I enter the pause menu the gamepad input will only move the focus between the resume and load buttons (+ the issue with moving up from the resume buttons is still there). However, the focus won't ever move down to the exit button. It can however be clicked with the mouse. How do I solve this?
Thanks!
I have a very basic placeholder pause menu for the game I am developing. The layout code looks like this:
Code: Select all
<Border Grid.Row="1" Grid.Column="1" Background="#FF474F54" BorderBrush="#FF2F3538" BorderThickness="2" CornerRadius="5">
<StackPanel Margin="5">
<TextBlock HorizontalAlignment="Center" Margin="0,0,0,8" FontSize="30" Text="{Binding UILanguage.Resources[TEXT_UI_PAUSED], FallbackValue='Paused'}"/>
<Button x:Name="ResumeButton" Margin="0,0,0,4" Command="{Binding PauseResume}" Content="{Binding UILanguage.Resources[TEXT_UI_RESUME], FallbackValue='Resume'}"/>
<Button x:Name="LoadButton" Margin="0,0,0,4" Command="{Binding PauseLoadGame}" Content="{Binding UILanguage.Resources[TEXT_UI_LOAD_GAME], FallbackValue='Load game'}"/>
<Button x:Name="ExitButton" Command="{Binding PauseExit}" Content="{Binding UILanguage.Resources[TEXT_UI_EXIT], FallbackValue='Exit'}"/>
</StackPanel>
</Border>
My second issue started occuring when I added the load button between the other two buttons. Now when I enter the pause menu the gamepad input will only move the focus between the resume and load buttons (+ the issue with moving up from the resume buttons is still there). However, the focus won't ever move down to the exit button. It can however be clicked with the mouse. How do I solve this?
Thanks!