Improve style in many demos (#1263)

This commit is contained in:
Aaron Franke
2025-10-11 05:03:59 -07:00
committed by GitHub
parent 0ae09b7e5a
commit 520b4a7870
197 changed files with 904 additions and 766 deletions

View File

@@ -3,7 +3,7 @@ extends Control
## The 3D viewport's shrink factor. For instance, 1 is full resolution,
## 2 is half resolution and 4 is quarter resolution. Lower values look
## sharper but are slower to render.
var scale_factor := 1
var scale_factor: int = 1
var filter_mode := Viewport.SCALING_3D_MODE_BILINEAR
@@ -16,13 +16,13 @@ func _ready() -> void:
viewport.scaling_3d_mode = filter_mode
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed(&"cycle_viewport_resolution"):
func _unhandled_input(input_event: InputEvent) -> void:
if input_event.is_action_pressed(&"cycle_viewport_resolution"):
scale_factor = wrapi(scale_factor + 1, 1, 5)
viewport.scaling_3d_scale = 1.0 / scale_factor
scale_label.text = "Scale: %3.0f%%" % (100.0 / scale_factor)
if event.is_action_pressed(&"toggle_filtering"):
if input_event.is_action_pressed(&"toggle_filtering"):
filter_mode = wrapi(filter_mode + 1, Viewport.SCALING_3D_MODE_BILINEAR, Viewport.SCALING_3D_MODE_MAX) as Viewport.Scaling3DMode
viewport.scaling_3d_mode = filter_mode
filter_label.text = (