feat: properly scale instantiated dragons
This commit is contained in:
parent
a169e953c3
commit
09586aaa5e
5 changed files with 12 additions and 5 deletions
|
@ -28,7 +28,7 @@ func _calculate_relative_position(position: Vector2) -> Vector2i:
|
|||
|
||||
|
||||
func _instantiate_dragon(relative_position: Vector2i) -> Node:
|
||||
var dragon: Window = _dragon_template.instantiate()
|
||||
var dragon: Dragon = _dragon_template.instantiate()
|
||||
|
||||
var window_position: Vector2i = DisplayServer.window_get_position()
|
||||
var window_size: Vector2i = DisplayServer.window_get_size()
|
||||
|
@ -36,8 +36,7 @@ func _instantiate_dragon(relative_position: Vector2i) -> Node:
|
|||
dragon.position = window_position + relative_position - dragon.size / 2
|
||||
|
||||
var size: float = _calculate_window_scale().y
|
||||
dragon.size = Vector2i(dragon.size.x * size, dragon.size.y * size)
|
||||
dragon.content_scale_factor = 0.5
|
||||
dragon.set_scale(size)
|
||||
dragon.main_window_rect = Rect2i(window_position, window_size)
|
||||
dragon.show()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue