add slider for setting overlay size

This commit is contained in:
Crispy 2021-06-05 00:32:32 +02:00
parent 7ab22b73d8
commit d14e90bb3c
7 changed files with 70 additions and 1 deletions

View file

@ -0,0 +1 @@
<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><rect fill="#e0e0e0" height="6.1027" ry=".76286" transform="matrix(.70710678 -.70710678 .70710678 .70710678 1.002946 -1043.3636)" width="6.1027" x="-741.53003" y="741.08002"/></svg>

After

Width:  |  Height:  |  Size: 265 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/handle.svg-242cd3e4d69885cc43f9fb8909ecd878.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icons/handle.svg"
dest_files=[ "res://.import/handle.svg-242cd3e4d69885cc43f9fb8909ecd878.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=10.0

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -104,13 +104,36 @@ margin_right = 176.0
margin_bottom = 191.0
icon = ExtResource( 2 )
[node name="Size" type="Button" parent="MoreOptions/Container/List"]
[node name="SetSize" type="Button" parent="MoreOptions/Container/List"]
margin_left = 180.0
margin_right = 356.0
margin_bottom = 191.0
toggle_mode = true
icon = ExtResource( 4 )
[node name="PanelContainer" type="PanelContainer" parent="MoreOptions/Container/List/SetSize"]
anchor_top = -0.016
anchor_right = 1.0
anchor_bottom = -0.016
margin_top = -464.944
margin_bottom = 0.0560002
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SizeSlider" type="VSlider" parent="MoreOptions/Container/List/SetSize/PanelContainer"]
margin_left = 8.0
margin_top = 8.0
margin_right = 108.0
margin_bottom = 457.0
min_value = 0.1
max_value = 1.0
step = 0.05
value = 0.1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Target" type="OptionButton" parent="MoreOptions/Container/List"]
margin_left = 360.0
margin_right = 540.0
@ -137,6 +160,8 @@ icon = ExtResource( 11 )
[connection signal="toggled" from="BasicOptions/List/Visibility" to="." method="_on_Visibility_toggled"]
[connection signal="pressed" from="BasicOptions/List/Options" to="." method="_on_Options_pressed"]
[connection signal="pressed" from="MoreOptions/Container/List/Remove" to="." method="_on_Remove_pressed"]
[connection signal="toggled" from="MoreOptions/Container/List/SetSize" to="." method="_on_SetSize_toggled"]
[connection signal="value_changed" from="MoreOptions/Container/List/SetSize/PanelContainer/SizeSlider" to="." method="_on_SizeSlider_value_changed"]
[connection signal="item_selected" from="MoreOptions/Container/List/Target" to="." method="_on_Target_item_selected"]
[connection signal="pressed" from="MoreOptions/Container/List/Reset" to="." method="_on_Reset_pressed"]
[connection signal="pressed" from="MoreOptions/Container/List/CloseOptions" to="." method="_on_CloseOptions_pressed"]

View file

@ -5,6 +5,7 @@ var overlay
func _ready() -> void:
overlay = OverlayManager.get_node(overlay_name)
$MoreOptions/Container/List/SetSize/PanelContainer.visible = false
$MoreOptions.visible = false
$BasicOptions/Label.text = overlay_name
name = overlay_name
@ -48,3 +49,11 @@ func _on_Options_pressed() -> void:
func _on_CloseOptions_pressed() -> void:
$MoreOptions.visible = false
func _on_SetSize_toggled(state: bool) -> void:
$MoreOptions/Container/List/SetSize/PanelContainer.visible = state
func _on_SizeSlider_value_changed(value: float) -> void:
overlay.width_meters = value