Skip to content
Feniks Development
  • Start Here
  • Glossary
  • Tools
  • Resources
  • What’s New
  • About
  • Contact
Toggle the button to expand or collapse the Menu

Controller Bar

  1. Home>
  2. Feniks Tools>
  3. Controller Bar

Easy Blinking

  • EasyBlink Class
  • EasyBlink Examples

Controller Support Expansion

  • What is the Controller Support Expansion?
  • How do I…? + Common Issues
  • Controller Viewport
  • Controller Bar
  • Virtual Cursor
  • Virtual Keyboard
  • StickEvent
  • KeyController and focused_on
  • FocusDisplayable
  • Remapping Controls
  • Controller and Keyboard Icons
  • Configuration Variables
  • Screen Actions and Values
  • Helper Functions and Classes
  • Engine Override Notes

Sound Disabler and Captions Tool

  • Disabling Sounds and Sound Categorization
View Categories
  • Home
  • Feniks Tools
  • Controller Support Expansion
  • Controller Bar

Controller Bar

1 min read

Controller Support Expansion for Ren’Py includes several features to improve controller and keyboard support in Ren’Py. Pick up the tool from itch.io if you haven’t already:

Contents hide
ControllerBar
Examples
Design Notes

ControllerBar

ControllerBar is a controller- and keyboard-friendly bar variant which does not need to be grabbed to be adjusted. controller_bar is horizontal and can be controlled immediately with left/right input, and controller_vbar is vertical and can be controlled with up/down input. It is intended for bars which will be adjusted by the user; if a bar’s value is controlled by the game (e.g. a health bar), then a regular bar/vbar is sufficient.

ControllerBar takes all the same properties as a regular bar does; see https://www.renpy.org/doc/html/screens.html#bar for more information. It also functions identically to a regular bar when the mouse is used; the only changes are for when the bar gains focus with the arrow keys or controller directional inputs.

Examples

controller_bar is for horizontal bars. It’s useful for most preferences screens.

vbox:
    label _("Text Speed")
    controller_bar value Preference("text speed")

controller_vbar is similar, but creates a vertical bar rather than a horizontal one (like vbar vs bar). This can be used for preference screens or gameplay options as well. For scroll bars, I recommend using the Controller Viewport instead.

hbox:
    label _("Music Volume")
    controller_vbar value Preference("music volume") style "my_music_bar"

You can also provide your own adjustable values:

screen battle():
    controller_bar:
        value FieldValue(player, "health", range=100)
        align (1.0, 0.0) ysize 50 xsize 200

Design Notes

ControllerBar is best used when the bar in question is part of a column (for controller_bar) or row (for controller_vbar) of other items. Due to how the bar is auto-selected once focused, you will be unable to use left/right input for controller_bar to focus anything to the left or right of the bar, since it will adjust the value of the bar rather than focusing an item to the left/right. The same applies to up/down input for controller_vbar. In more concrete terms, layouts like this work best with controller and keyboard navigation:

A preferences screen is shown, with the Audio tab selected. Several volume control bars are arranged in a column.

In this example, the bars are focused using the up/down inputs, and left/right is solely for adjusting the bar value. Other shortcuts are used to navigate to different pages or dismiss the menu.

Updated on February 9, 2025
Controller ViewportVirtual Cursor

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© Copyright – Feniks with OceanWP
Close Menu