Remove CCS viewport letterboxing
This commit is contained in:
@@ -270,14 +270,18 @@ grow_vertical = 2
|
|||||||
mouse_filter = 2
|
mouse_filter = 2
|
||||||
texture = ExtResource("7_computer")
|
texture = ExtResource("7_computer")
|
||||||
expand_mode = 1
|
expand_mode = 1
|
||||||
stretch_mode = 5
|
stretch_mode = 0
|
||||||
|
|
||||||
[node name="Close" type="Button" parent="ComputerOverlay"]
|
[node name="Close" type="Button" parent="ComputerOverlay"]
|
||||||
layout_mode = 0
|
layout_mode = 1
|
||||||
offset_left = 1512.0
|
anchors_preset = 1
|
||||||
|
anchor_left = 1.0
|
||||||
|
anchor_right = 1.0
|
||||||
|
offset_left = -88.0
|
||||||
offset_top = 20.0
|
offset_top = 20.0
|
||||||
offset_right = 1576.0
|
offset_right = -24.0
|
||||||
offset_bottom = 84.0
|
offset_bottom = 84.0
|
||||||
|
grow_horizontal = 0
|
||||||
mouse_default_cursor_shape = 2
|
mouse_default_cursor_shape = 2
|
||||||
tooltip_text = "Close computer"
|
tooltip_text = "Close computer"
|
||||||
icon = ExtResource("9_close")
|
icon = ExtResource("9_close")
|
||||||
|
|||||||
@@ -346,7 +346,8 @@ func _render_choice_page() -> void:
|
|||||||
var option_text := str(option.get("text", ""))
|
var option_text := str(option.get("text", ""))
|
||||||
var button := TextureButton.new()
|
var button := TextureButton.new()
|
||||||
button.set_meta("choice_id", choice_id)
|
button.set_meta("choice_id", choice_id)
|
||||||
button.custom_minimum_size = Vector2(350.0, 136.0)
|
button.custom_minimum_size = Vector2(0.0, 136.0)
|
||||||
|
button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
button.ignore_texture_size = true
|
button.ignore_texture_size = true
|
||||||
button.stretch_mode = TextureButton.STRETCH_SCALE
|
button.stretch_mode = TextureButton.STRETCH_SCALE
|
||||||
button.texture_normal = _crop_choice_texture(CHOICE_NORMAL)
|
button.texture_normal = _crop_choice_texture(CHOICE_NORMAL)
|
||||||
@@ -363,9 +364,9 @@ func _render_choice_page() -> void:
|
|||||||
|
|
||||||
var label := Label.new()
|
var label := Label.new()
|
||||||
label.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
label.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
label.offset_left = 48.0
|
label.offset_left = 28.0
|
||||||
label.offset_top = 12.0
|
label.offset_top = 12.0
|
||||||
label.offset_right = -48.0
|
label.offset_right = -28.0
|
||||||
label.offset_bottom = -12.0
|
label.offset_bottom = -12.0
|
||||||
label.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
label.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
label.add_theme_color_override("font_color", Color(0.055, 0.105, 0.145))
|
label.add_theme_color_override("font_color", Color(0.055, 0.105, 0.145))
|
||||||
|
|||||||
@@ -379,6 +379,6 @@ func _fit_stage() -> void:
|
|||||||
var available := size
|
var available := size
|
||||||
if available.x <= 0.0 or available.y <= 0.0:
|
if available.x <= 0.0 or available.y <= 0.0:
|
||||||
return
|
return
|
||||||
var fit_scale := minf(available.x / DESIGN_SIZE.x, available.y / DESIGN_SIZE.y)
|
stage_root.scale = Vector2.ONE
|
||||||
stage_root.scale = Vector2.ONE * fit_scale
|
stage_root.position = Vector2.ZERO
|
||||||
stage_root.position = (available - DESIGN_SIZE * fit_scale) * 0.5
|
stage_root.size = available
|
||||||
|
|||||||
@@ -91,12 +91,13 @@ func _run() -> void:
|
|||||||
_assert(screen.active_scene.is_computer_open(), "the computer launcher should open the simulated desktop")
|
_assert(screen.active_scene.is_computer_open(), "the computer launcher should open the simulated desktop")
|
||||||
_assert(not screen.active_scene.computer_launcher.visible, "the launcher should hide while the computer is open")
|
_assert(not screen.active_scene.computer_launcher.visible, "the launcher should hide while the computer is open")
|
||||||
_assert(screen.active_scene.computer_overlay.get_node("Screen").texture.resource_path.ends_with("computer-base.png"), "the overlay should render the supplied computer base")
|
_assert(screen.active_scene.computer_overlay.get_node("Screen").texture.resource_path.ends_with("computer-base.png"), "the overlay should render the supplied computer base")
|
||||||
_assert(screen.active_scene.computer_overlay.get_node("Screen").stretch_mode == TextureRect.STRETCH_KEEP_ASPECT_CENTERED, "the computer should be fully contained without cropping")
|
_assert(screen.active_scene.computer_overlay.get_node("Screen").stretch_mode == TextureRect.STRETCH_SCALE, "the computer should fill the viewport without side bars")
|
||||||
_assert(screen.close_transient_overlay(), "Escape routing should close the computer before the pause menu")
|
_assert(screen.close_transient_overlay(), "Escape routing should close the computer before the pause menu")
|
||||||
_assert(not screen.active_scene.is_computer_open(), "closing the transient overlay should restore the doctor office")
|
_assert(not screen.active_scene.is_computer_open(), "closing the transient overlay should restore the doctor office")
|
||||||
_assert(not screen.close_transient_overlay(), "a second Escape should be available to open the pause menu")
|
_assert(not screen.close_transient_overlay(), "a second Escape should be available to open the pause menu")
|
||||||
_assert(is_equal_approx(screen.DESIGN_SIZE.x / screen.DESIGN_SIZE.y, 16.0 / 9.0), "the graphical CCS stage should use a true 16:9 design canvas")
|
_assert(is_equal_approx(screen.DESIGN_SIZE.x / screen.DESIGN_SIZE.y, 16.0 / 9.0), "the graphical CCS stage should use a true 16:9 design canvas")
|
||||||
_assert(is_equal_approx(screen.stage_root.scale.x, screen.stage_root.scale.y), "the graphical stage should preserve its aspect ratio")
|
_assert(screen.stage_root.size.is_equal_approx(screen.size), "the graphical stage should fill the available viewport")
|
||||||
|
_assert(screen.stage_root.position.is_equal_approx(Vector2.ZERO), "the graphical stage should not introduce letterbox margins")
|
||||||
var stale_graphical_attempt := _sample_attempt(false)
|
var stale_graphical_attempt := _sample_attempt(false)
|
||||||
stale_graphical_attempt.experienceMode = "graphical_interview"
|
stale_graphical_attempt.experienceMode = "graphical_interview"
|
||||||
stale_graphical_attempt.openingCompleted = true
|
stale_graphical_attempt.openingCompleted = true
|
||||||
|
|||||||
Reference in New Issue
Block a user