mirror of
https://github.com/csd4ni3l/fishy-fingers.git
synced 2026-03-10 08:59:17 +01:00
11 lines
291 B
GDScript
11 lines
291 B
GDScript
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()
|