2019-12-21 20:42:19 +10:30
|
|
|
extends Viewport
|
|
|
|
|
2021-01-01 23:51:41 +10:30
|
|
|
onready var base_height = ProjectSettings.get_setting('display/window/size/height')
|
2020-12-23 00:02:30 +10:30
|
|
|
|
2019-12-21 20:42:19 +10:30
|
|
|
func set_render_scale(scale: Vector2):
|
2020-12-22 23:07:46 +10:30
|
|
|
var ws = OS.window_size
|
|
|
|
var dim = min(ws.x, ws.y)
|
|
|
|
size = Vector2(dim, dim) * scale
|
2019-12-21 20:42:19 +10:30
|
|
|
$Center.position = size * 0.5
|
2021-01-01 23:51:41 +10:30
|
|
|
$Center.scale = size/base_height
|
2019-12-21 20:42:19 +10:30
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
2021-01-14 20:35:30 +10:30
|
|
|
Settings.connect('subsampling_changed', self, 'set_render_scale')
|
|
|
|
set_render_scale(Settings.subsampling)
|