bgui_utils

class bgui.bgui_utils.Layout(sys, data)

Bases: Widget

A base layout class to be used with the BGUI System

Parameters:
  • sys – The BGUI system.

  • data – User data.

update()

A function that is called by the system to update the widget (subclasses should override this)

class bgui.bgui_utils.System(theme=None)

Bases: System

A system that is intended to be used with BGE games

Parameters:
  • theme – The path to a theme directory.

  • data – User data.

load_layout(layout, data=None)

Load a layout and replace any previously loaded layout

Parameters:
  • layout – The layout to load (None to have no layouts loaded).

  • data – User data to send to the layout’s constructor.

add_overlay(overlay, data=None)

Add an overlay layout, which sits on top of the currently loaded layout

Parameters:
  • overlay – The layout to add as an overlay.

  • data – User data to send to the layout’s constructor.

remove_overlay(overlay)

Remove an overlay layout by name

Parameters:

overlay – The class name of the overlay to remove (this is the same name as the layout used to add the overlay)

toggle_overlay(overlay, data=None)

Toggle an overlay (if the overlay is active, remove it, otherwise add it)

Parameters:
  • overlay – The class name of the layout to toggle.

  • data – User data to send to the layout’s constructor.

run()

A high-level method to be run every frame