Skip to main content

Module debug

Module debug 

Source
Expand description

The developer’s debug screens: a menu of the game’s tools (DebugMenuScreen, with the game’s and its modules’ DebugEntrys), the glyph sampler that shows every glyph of the font and every color of the palette (GlyphSamplerScreen), the scene camera over a picture of the game’s (SceneCameraScreen), and the hint that names the Debug key (hint). Debug tools are in English only.

The debug view (ADR-0085) draws what a running game’s logic sees over it, as Godot’s “Visible Collision Shapes” does: each screen hands in gizmo::Gizmos from Screen::debug_draw, each in a gizmo::Channel with a gizmo::GizmoRole, and the channels on (Ctx::debug_view) are drawn over the frame in the debug tools’ colours (glyph::paint_gizmos). The menu’s “Debug view” entry (DebugViewScreen) turns them on and off. The grid kit’s layout is the grid channel (crate::grid::debug).

The look is a skin: the menu says what it shows as a DebugMenuView and glyph::paint draws it; the scene camera’s SceneCameraView, glyph::paint_camera; the debug view’s screen’s DebugViewView, glyph::paint_view.

Re-exports§

pub use camera::CameraLayout;
pub use camera::SceneCameraScreen;
pub use gizmo::Channel;
pub use gizmo::DebugView;
pub use gizmo::Gizmo;
pub use gizmo::GizmoRole;
pub use gizmo::Gizmos;
pub use view::DebugViewScreen;

Modules§

camera
The scene camera (the game’s ticket 0228, moved here in 1154): a picture (a whole map, MapPicture) as a backdrop (game ADR-0048) behind a window of the console, panned by the pixel and zoomed in whole steps, with a caption and a text box over it. For checking by eye that a renderer keeps the scene sharp and seamless.
gizmo
The debug view’s data (ADR-0085): what a screen hands in to be drawn over the running game (Gizmos, each in a Channel with a GizmoRole), one frame’s list of them (Gizmos), and which channels are on (DebugView, on Ctx::debug_view).
glyph
The glyph look of the debug screens: the debug menu (paint), the glyph sampler (sampler), the scene camera (paint_camera), the Debug key’s hint (paint_hint), the debug view’s screen (paint_view) and its gizmos over the frame (paint_gizmos).
view
The “Debug view” screen of the debug menu (ADR-0085): every channel the running screens have offered, each on or off, toggled with Confirm. The choice is saved (Ctx::set_debug_channel); the game shows the channels on over its screens once the menu is closed.

Structs§

DebugEntry
One tool on the debug menu: what the menu calls it (which may name something in ctx, such as a look in use) and what choosing it does.
DebugMenuScreen
The debug menu the Debug key opens: the game’s tools, in its order, then each installed module’s (Install::debug_entry), in install order, then the engine’s: while the platform records the run or plays a record (Ctx::session_recording), “Save session”, and “Debug view” (DebugViewScreen). Cancel closes it. A tool that opens nothing leaves the menu on it, its names read again.
DebugMenuView
What the debug menu shows.
GlyphSamplerScreen
The glyph_sampler as a screen; Cancel closes it.

Functions§

hint
The debug-menu hint, e.g. F2 debug: None unless debug tools are on and the game’s Debug action has a key (it isn’t rebindable, so no ! not mapped hint for it).

Type Aliases§

Label
What a debug tool is called on the menu, read from the context.
Run
What choosing a debug tool does, given the context. Its own state (how many times it ran, say) lives in the closure.
SamplePanels
What the glyph sampler adds under its palette: the game’s sample panels from row top down, in its colors.