Controller Input Bindings
Written By Brian Faeran
Last updated 9 months ago
ControllerBindingDisplay
This control dynamically displays the graphic of a controller button associated with a specific action, ensuring accuracy based on the user's controller mappings. The particular graphic displayed is determined by the user's selected Controller Input Media Pack within LaunchBox, accessible under Tools > Manage > LaunchBox Themes and Media. By leveraging this feature, themes can provide an intuitive and visually engaging way to guide users through their inputs and interactions.
NameSpace
The following namespace needs to be added to the view you would like to use this control in:
xmlns:bbCon="clr-namespace:Unbroken.LaunchBox.Windows.BigBox.Controls;assembly=BigBox"Properties
ControllerBindingDisplay is a container that will contain the template of what you’d like the layout of the control to look like. It contains the following property:
Binding - The mapping you’d like to display
Possible binding values:
Search
ShowGameDetails
SwitchImageType
SwitchView
Exit
ShowImages
PlayMusic
FlipBox
PageDown
PageUp
PlayGame
Back
Select
NextMusicTrack
PreviousMusicTrack
ShowDiscoveryCenter
ShowAllGames
ShowGenres
ShowPlatforms
ShowPlaylists
ShowDevelopers
ShowPublishers
ShowRatings
ShowPlayModes
ShowRegions
ShowSeries
ShowStatuses
ShowSources
ShowPlatformCategories
Filter
StartAttractMode
WheelSpin
SwitchTheme
ShowAchievements
ShowAchievementProfile
SetStarRating
ZoomIn
ZoomOut
LockUnlock
ShowPauseScreen
ExitGame
FocusInterface
VolumeUp
VolumeDown
NavigateUp
NavigateDown
NavigateLeft
NavigateRight
ShowHighScores
Screenshot
ViewSystemMenu
OpenIndex
RotateModelUp
RotateModelDown
RotateModelLeft
RotateModelRight
ShowModel
Inside the ControllerBindingDisplay is a template that has the following:
ControllerBindingImage - Displays an image based on the above binding value
BindingLabel - Displays the label of what the binding is called. The label will automatically translate into the user's preferred language.
Example
This example was taken from the default theme and shows off displaying the controller button that is mapped to the Select mapping in Big Box, along with a translatable text string that would display the words “Select”:
Example<bbCon:ControllerBindingDisplay Binding="Select" HorizontalAlignment="Right">
<bbCon:ControllerBindingDisplay.ControlTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<bbCon:ControllerBindingImage Binding="{Binding Binding}" Height="{Binding Converter={StaticResource ScaleConverter}, ConverterParameter='30'}"
Margin="{Binding Converter={StaticResource ScaleConverter}, ConverterParameter='0,3,10,0'}" VerticalAlignment="Center" ItemSpacing="10"/>
<TextBlock Text="{Binding Converter={StaticResource UpperCase}, Path=BindingLabel}" FontWeight="Regular" FontSize="{Binding Converter={StaticResource ScaleConverter}, ConverterParameter='28'}" Foreground="White" />
</StackPanel>
</DataTemplate>
</bbCon:ControllerBindingDisplay.ControlTemplate>
</bbCon:ControllerBindingDisplay>