simvx.core.project¶
Project configuration — simvx.toml files.
Schema-driven TOML file describing a SimVX game’s display, physics, input, audio, rendering, export, and editor settings. Uses stdlib tomllib for reading and a small hand-rolled writer for round-tripping.
Public API: from simvx.core.project import ProjectSettings, load_project, save_project
settings = load_project("simvx.toml")
settings.name = "My Game"
save_project(settings, "simvx.toml")
Module Contents¶
Classes¶
TOML-based project configuration. |
Functions¶
Convert a TOML [input] value (legacy string list or structured list) to bindings. |
|
Serialise a list of InputBindings to a list of inline-table dicts. |
|
Load project settings from a simvx.toml file. |
|
Save project settings to a simvx.toml file. |
|
Search up the directory tree for simvx.toml. |
Data¶
API¶
- simvx.core.project.log¶
‘getLogger(…)’
- simvx.core.project.__all__¶
[‘ProjectSettings’, ‘ValidationError’, ‘load_project’, ‘save_project’, ‘find_project’, ‘input_bindin…
- simvx.core.project.TOML_FILENAME¶
‘simvx.toml’
- simvx.core.project.input_bindings_from_toml(action: str, entries: list[Any]) list[simvx.core.input.events.InputBinding][source]¶
Convert a TOML [input] value (legacy string list or structured list) to bindings.
- simvx.core.project.input_bindings_to_toml(bindings: list[simvx.core.input.events.InputBinding]) list[dict[str, Any]][source]¶
Serialise a list of InputBindings to a list of inline-table dicts.
- exception simvx.core.project.ValidationError[source]¶
Bases:
ValueErrorRaised when simvx.toml contains invalid values.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- class __cause__¶
- class __context__¶
- __delattr__()¶
- __dir__()¶
- __eq__()¶
- __format__()¶
- __ge__()¶
- __getattribute__()¶
- __getstate__()¶
- __gt__()¶
- __hash__()¶
- __le__()¶
- __lt__()¶
- __ne__()¶
- __new__()¶
- __reduce__()¶
- __reduce_ex__()¶
- __repr__()¶
- __setattr__()¶
- __setstate__()¶
- __sizeof__()¶
- __str__()¶
- __subclasshook__()¶
- class __suppress_context__¶
- class __traceback__¶
- add_note()¶
- class args¶
- with_traceback()¶
- class simvx.core.project.ProjectSettings(data: dict[str, Any] | None = None)[source]¶
TOML-based project configuration.
Sections are stored as plain dicts for simplicity and easy serialization. Top-level fields (name, main) are direct attributes.
Initialization
- __slots__¶
(‘name’, ‘main’, ‘display’, ‘input’, ‘physics’, ‘audio’, ‘rendering’, ‘export_web’, ‘export_desktop’…
- simvx.core.project.load_project(path: str | pathlib.Path) simvx.core.project.ProjectSettings[source]¶
Load project settings from a simvx.toml file.
Raises: FileNotFoundError: If the file does not exist. tomllib.TOMLDecodeError: If the file is not valid TOML. ValidationError: If values fail schema validation.
- simvx.core.project.save_project(settings: simvx.core.project.ProjectSettings, path: str | pathlib.Path | None = None) None[source]¶
Save project settings to a simvx.toml file.
Args: settings: ProjectSettings to save. path: Output file path. If None, uses settings.project_path.