mirror of
https://github.com/csd4ni3l/fishy-fingers.git
synced 2026-03-10 17:09:15 +01:00
Godot upload
This commit is contained in:
10
assets/scripts/background_scaler.gd
Normal file
10
assets/scripts/background_scaler.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
extends Sprite2D
|
||||
|
||||
func scale_to_window():
|
||||
var window_size = get_viewport_rect().size
|
||||
var texture_size = texture.get_size()
|
||||
scale = window_size / texture_size
|
||||
position = window_size / 2 # Center it (origin is top-left by default)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
scale_to_window()
|
||||
Reference in New Issue
Block a user