baremote package¶
Using a device as a game controller (in development for 1.9).
- class baremote.RemoteAppMode[source]¶
Bases:
AppModeThe app-mode for using a device as a game controller.
This turns a phone or tablet into a controller for a game on the same network; it is the future home of the BombSquad Remote app (in development for 1.9).
Currently a placeholder with no ui of its own: it connects to the first game it finds, and while connected the device’s touchscreen controls (or a keyboard or gamepad) drive a player in that game. Progress is reported as screen-messages and
ba.netlog lines. It is not in the project’s default app-modes, so the app never selects it on its own; it can be switched to manually via the dev-console’s AppModes tab.- classmethod can_handle_intent(intent: AppIntent) bool[source]¶
Override this to define indent handling for an app-mode.
- on_activate(config: AppModeConfig) None[source]¶
Called when the mode is becoming the active one for the app.
configis the object created bynew_app_mode_config()for this activation, possibly amended by plugins. Modes that define their own config type should begin withassert isinstance(config, TheirConfig)to recover the concrete type, then set themselves (and any app-subsystems they use) up from it.
- on_deactivate() None[source]¶
Called when the mode stops being the active one for the app.
On platforms where the app is explicitly exited (such as desktop PC) this will also be called at app shutdown.
To best cover both mobile and desktop style platforms, actions such as saving state should generally happen in response to both
on_deactivate()andon_app_active_changed()(when active is False).
- class baremote.RemoteAppSubsystem[source]¶
Bases:
objectSubsystem for Remote functionality in the app.
If
has_python_app_subsystemis enabled for our feature-set, the single shared instance of this class can be accessed as remote on theAppinstance.