Implemented the resize window state.

This commit is contained in:
Relintai 2022-04-27 15:26:29 +02:00
parent e1241a6c2a
commit e198b3ddb7
2 changed files with 20 additions and 4 deletions

View File

@ -3,6 +3,7 @@ extends Control
var BaseClassArrow = preload("res://BaseClassArrow.tscn")
var ClassControl = preload("res://ClassControl.tscn")
export(NodePath) var main_container_path : NodePath
export(NodePath) var content_container_path : NodePath
enum States {
@ -156,11 +157,13 @@ func _process_state_next(delta):
_current_state = States.STATE_RESIZE_WINDOW
func _process_state_resize_window(delta):
pass
#_current_state = States.STATE_TAKE_SCREENSHOT
var rs : Vector2 = get_node(main_container_path).rect_size
OS.window_size = rs
_current_state = States.STATE_TAKE_SCREENSHOT
func _process_state_take_screenshot(delta):
return
_current_index += 1
_current_state = States.STATE_NEXT

View File

@ -8,10 +8,23 @@ anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 4 )
script = ExtResource( 1 )
content_container_path = NodePath("ScrollContainer/Content")
main_container_path = NodePath("ScrollContainer/MarginContainer")
content_container_path = NodePath("ScrollContainer/MarginContainer")
[node name="ScrollContainer" type="ScrollContainer" parent="."]
margin_right = 1024.0
margin_bottom = 600.0
[node name="Content" type="HBoxContainer" parent="ScrollContainer"]
[node name="MarginContainer" type="MarginContainer" parent="ScrollContainer"]
margin_right = 16.0
margin_bottom = 16.0
custom_constants/margin_right = 8
custom_constants/margin_top = 8
custom_constants/margin_left = 8
custom_constants/margin_bottom = 8
[node name="Content" type="HBoxContainer" parent="ScrollContainer/MarginContainer"]
margin_left = 8.0
margin_top = 8.0
margin_right = 8.0
margin_bottom = 8.0