simvx.editor.testing.hosting

The editor’s side of hosting, reduced to what a play-mode test needs.

A running game is reached through a SceneHost in the tree around it, never by publishing into the game directly. This builds that tree: one host over the game’s whole screen at the origin, so a position in it is the same position in the game, holding focus so keys, text and pads reach the game too.

Module Contents

Classes

HostedGame

A host tree with one focused SceneHost over the game play mode runs.

Functions

forward

Forward event through the one host this play mode’s game has in the test, built on first use.

API

class simvx.editor.testing.hosting.HostedGame(play_mode)[source]

A host tree with one focused SceneHost over the game play mode runs.

Initialization

forward(event: simvx.core.InputEvent) → bool[source]

Publish event into the host tree, as the window would; True when a game is there to hear it.

The host follows play mode’s tree, as the editor’s viewport does each frame, so after a stop it hosts nothing and forwards nothing.

simvx.editor.testing.hosting.forward(play_mode, event: simvx.core.InputEvent) → bool[source]

Forward event through the one host this play mode’s game has in the test, built on first use.