diff --git a/client/project.godot b/client/project.godot index 9c87665..fc1bef0 100644 --- a/client/project.godot +++ b/client/project.godot @@ -13,3 +13,10 @@ config_version=5 config/name="coc-rpg" config/description="AI-driven single-player party RPG. Code owns state. AI owns text." config/features=PackedStringArray("4.7") + +[display] + +window/size/viewport_width=1920 +window/size/viewport_height=1080 +window/stretch/mode="canvas_items" +window/stretch/aspect="keep" diff --git a/client/scripts/theme/theme_showcase.gd b/client/scripts/theme/theme_showcase.gd index 20a0d82..48fe2fb 100644 --- a/client/scripts/theme/theme_showcase.gd +++ b/client/scripts/theme/theme_showcase.gd @@ -8,7 +8,12 @@ const SERIF_ITALIC := "res://assets/theme/fonts/EBGaramond-Italic-VariableFont_w func _ready() -> void: theme = load(GAME_THEME) - set_anchors_preset(Control.PRESET_FULL_RECT) + # A root Control run directly (F6) is not reliably sized to the viewport by + # full-rect anchors — it collapses to (0,0), clipping the ScrollContainer and + # hiding everything. Size to the viewport explicitly (no full-rect anchors here: + # they conflict with setting `size` directly) and track resizes. + _fit_to_viewport() + get_viewport().size_changed.connect(_fit_to_viewport) var scroll := ScrollContainer.new() scroll.set_anchors_preset(Control.PRESET_FULL_RECT) add_child(scroll) @@ -27,6 +32,10 @@ func _ready() -> void: col.add_child(_surfaces()) +func _fit_to_viewport() -> void: + size = get_viewport_rect().size + + func _heading(text: String) -> Label: var l := Label.new() l.text = text