Compare commits
3 commits
f9875906af
...
1d6ae67c43
Author | SHA1 | Date | |
---|---|---|---|
1d6ae67c43 | |||
52a8960aa1 | |||
236d3d7202 |
10 changed files with 96 additions and 52 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 9d46a0ec051eda6c898c836922fc6622d063cc36
|
||||
Subproject commit c427f69f02ddeb85db3a38f230a0d8bf7682e074
|
|
@ -19,42 +19,42 @@ script = ExtResource("1_xnmp1")
|
|||
|
||||
[node name="SuiHeader" parent="." instance=ExtResource("2_pcev0")]
|
||||
layout_mode = 1
|
||||
offset_left = 171.0
|
||||
offset_top = 436.0
|
||||
offset_right = -282.0
|
||||
offset_bottom = -4.0
|
||||
offset_left = 11.0
|
||||
offset_top = 699.0
|
||||
offset_right = -1011.0
|
||||
offset_bottom = -18.0
|
||||
text = "Header: Normal [b]Bold[/b] [i]Italic[/i] [b][i]Bold Italic[/i][/b] [code]Code -->[/code]"
|
||||
|
||||
[node name="SuiIconButton" parent="." instance=ExtResource("1_3di6k")]
|
||||
layout_mode = 1
|
||||
offset_left = 671.0
|
||||
offset_top = 28.0
|
||||
offset_right = -32.0
|
||||
offset_bottom = -446.0
|
||||
offset_left = 1135.0
|
||||
offset_top = 692.0
|
||||
offset_right = -25.0
|
||||
offset_bottom = -14.0
|
||||
image = ExtResource("4_12skp")
|
||||
|
||||
[node name="SuiText" parent="." instance=ExtResource("4_1lt1v")]
|
||||
layout_mode = 1
|
||||
offset_left = 697.0
|
||||
offset_top = 245.0
|
||||
offset_right = -23.0
|
||||
offset_bottom = -185.0
|
||||
offset_left = 438.0
|
||||
offset_top = 714.0
|
||||
offset_right = -727.0
|
||||
offset_bottom = -18.0
|
||||
text = "Text: Normal [b]Bold[/b] [i]Italic[/i] [b][i]Bold Italic[/i][/b] [code]Code -->[/code]"
|
||||
|
||||
[node name="SuiTextButton" parent="." instance=ExtResource("2_dxvwu")]
|
||||
layout_mode = 1
|
||||
offset_left = 665.0
|
||||
offset_top = 368.0
|
||||
offset_right = -6.0
|
||||
offset_bottom = -8.0
|
||||
offset_left = 710.0
|
||||
offset_top = 693.0
|
||||
offset_right = -324.0
|
||||
offset_bottom = -11.0
|
||||
text = "Button: Normal [b]Bold[/b] [i]Italic[/i] [b][i]Bold Italic[/i][/b] [code]Code -->[/code]"
|
||||
|
||||
[node name="SuiScroller" parent="." instance=ExtResource("6_6g04c")]
|
||||
layout_mode = 1
|
||||
offset_left = 11.0
|
||||
offset_top = 8.0
|
||||
offset_right = -662.0
|
||||
offset_bottom = -324.0
|
||||
offset_right = -1124.0
|
||||
offset_bottom = -576.0
|
||||
|
||||
[node name="Control" type="Control" parent="SuiScroller"]
|
||||
anchors_preset = 0
|
||||
|
@ -107,10 +107,10 @@ color = Color(0.839216, 0.0196078, 0.196078, 1)
|
|||
|
||||
[node name="SuiScroller2" parent="." instance=ExtResource("6_6g04c")]
|
||||
layout_mode = 1
|
||||
offset_left = 348.0
|
||||
offset_top = 209.0
|
||||
offset_right = -325.0
|
||||
offset_bottom = -123.0
|
||||
offset_left = 338.0
|
||||
offset_top = 20.0
|
||||
offset_right = -814.0
|
||||
offset_bottom = -577.0
|
||||
|
||||
[node name="Control" type="Control" parent="SuiScroller2"]
|
||||
anchors_preset = 0
|
||||
|
|
|
@ -19,8 +19,8 @@ boot_splash/show_image=false
|
|||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=960
|
||||
window/size/viewport_height=540
|
||||
window/size/viewport_width=1440
|
||||
window/size/viewport_height=810
|
||||
window/size/resizable=false
|
||||
|
||||
[filesystem]
|
||||
|
|
|
@ -8,16 +8,16 @@ layout_mode = 3
|
|||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -780.0
|
||||
offset_bottom = -490.0
|
||||
offset_right = -1278.0
|
||||
offset_bottom = -765.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2_bnj46")
|
||||
|
||||
[node name="Text" type="RichTextLabel" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 180.0
|
||||
offset_bottom = 50.0
|
||||
offset_right = 162.0
|
||||
offset_bottom = 45.0
|
||||
theme = ExtResource("3_877pi")
|
||||
theme_override_font_sizes/normal_font_size = 35
|
||||
theme_override_font_sizes/bold_font_size = 35
|
||||
|
|
|
@ -8,8 +8,8 @@ layout_mode = 3
|
|||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -900.0
|
||||
offset_bottom = -480.0
|
||||
offset_right = -1290.0
|
||||
offset_bottom = -660.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2_g6elc")
|
||||
|
@ -20,13 +20,13 @@ ip_bottom = 5
|
|||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 60.0
|
||||
offset_bottom = 60.0
|
||||
offset_right = 150.0
|
||||
offset_bottom = 150.0
|
||||
theme = ExtResource("3_knxki")
|
||||
|
||||
[node name="Icon" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 5.0
|
||||
offset_right = 60.0
|
||||
offset_bottom = 60.0
|
||||
offset_right = 150.0
|
||||
offset_bottom = 150.0
|
||||
|
|
|
@ -9,20 +9,22 @@ layout_mode = 3
|
|||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -860.0
|
||||
offset_bottom = -440.0
|
||||
offset_right = -1053.33
|
||||
offset_bottom = -563.333
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_dcfql")
|
||||
speed_value = 0.0
|
||||
|
||||
[node name="HScrollBar" type="HScrollBar" parent="."]
|
||||
modulate = Color(1, 1, 1, 0.501961)
|
||||
layout_mode = 1
|
||||
offset_top = 86.5
|
||||
offset_right = 86.5
|
||||
offset_bottom = 100.0
|
||||
offset_top = 226.417
|
||||
offset_right = 366.417
|
||||
offset_bottom = 246.667
|
||||
theme = ExtResource("2_4lteo")
|
||||
max_value = 386.667
|
||||
step = 1.0
|
||||
page = 1.0
|
||||
|
||||
[node name="VScrollBar" type="VScrollBar" parent="."]
|
||||
modulate = Color(1, 1, 1, 0.501961)
|
||||
|
@ -30,7 +32,10 @@ layout_mode = 1
|
|||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -13.5
|
||||
offset_bottom = 86.5
|
||||
offset_left = -20.25
|
||||
offset_bottom = 226.417
|
||||
grow_horizontal = 0
|
||||
theme = ExtResource("2_4lteo")
|
||||
max_value = 246.667
|
||||
step = 1.0
|
||||
page = 1.0
|
||||
|
|
|
@ -8,15 +8,15 @@ layout_mode = 3
|
|||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -850.0
|
||||
offset_bottom = -503.0
|
||||
offset_right = -1345.0
|
||||
offset_bottom = -773.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2_87ovr")
|
||||
|
||||
[node name="Text" type="RichTextLabel" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 110.0
|
||||
offset_right = 95.0
|
||||
offset_bottom = 37.0
|
||||
theme = ExtResource("3_fttgr")
|
||||
theme_override_font_sizes/normal_font_size = 25
|
||||
|
|
|
@ -9,22 +9,22 @@ layout_mode = 3
|
|||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -700.0
|
||||
offset_bottom = -490.0
|
||||
offset_right = -1224.0
|
||||
offset_bottom = -757.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2_43xd1")
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 260.0
|
||||
offset_bottom = 50.0
|
||||
offset_right = 216.0
|
||||
offset_bottom = 53.0
|
||||
theme = ExtResource("3_u0br7")
|
||||
|
||||
[node name="Text" type="RichTextLabel" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 260.0
|
||||
offset_bottom = 50.0
|
||||
offset_right = 216.0
|
||||
offset_bottom = 53.0
|
||||
mouse_filter = 2
|
||||
theme = ExtResource("4_vp57w")
|
||||
theme_override_font_sizes/normal_font_size = 35
|
||||
|
|
|
@ -149,6 +149,39 @@ func update_element() -> void:
|
|||
$HScrollBar.max_value = size.x
|
||||
$VScrollBar.max_value = size.y
|
||||
|
||||
func scroll(direction: SuiTypes.ScrollDirection) -> void:
|
||||
var bar: ScrollBar
|
||||
var dsign: int = 0
|
||||
|
||||
# Set 'dsign'
|
||||
match(direction):
|
||||
SuiTypes.ScrollDirection.UP: dsign = +1
|
||||
SuiTypes.ScrollDirection.DOWN: dsign = -1
|
||||
SuiTypes.ScrollDirection.LEFT: dsign = -1
|
||||
SuiTypes.ScrollDirection.RIGHT: dsign = +1
|
||||
|
||||
# Set 'bar'
|
||||
match(direction):
|
||||
SuiTypes.ScrollDirection.UP: bar = $VScrollBar
|
||||
SuiTypes.ScrollDirection.DOWN: bar = $VScrollBar
|
||||
SuiTypes.ScrollDirection.LEFT: bar = $HScrollBar
|
||||
SuiTypes.ScrollDirection.RIGHT: bar = $HScrollBar
|
||||
|
||||
bar.value = bar.value + bar.step * 50 * dsign
|
||||
|
||||
func _input(event: InputEvent):
|
||||
if event is InputEventMouseButton:
|
||||
if event.is_pressed():
|
||||
match(event.button_index):
|
||||
MouseButton.MOUSE_BUTTON_WHEEL_UP:
|
||||
if Input.is_key_pressed(Key.KEY_SHIFT): scroll(SuiTypes.ScrollDirection.LEFT)
|
||||
else: scroll(SuiTypes.ScrollDirection.DOWN)
|
||||
MouseButton.MOUSE_BUTTON_WHEEL_DOWN:
|
||||
if Input.is_key_pressed(Key.KEY_SHIFT): scroll(SuiTypes.ScrollDirection.RIGHT)
|
||||
else: scroll(SuiTypes.ScrollDirection.UP)
|
||||
MouseButton.MOUSE_BUTTON_WHEEL_LEFT: scroll(SuiTypes.ScrollDirection.RIGHT)
|
||||
MouseButton.MOUSE_BUTTON_WHEEL_RIGHT: scroll(SuiTypes.ScrollDirection.LEFT)
|
||||
|
||||
func _get_configuration_warnings():
|
||||
if get_child_count() != 3:
|
||||
return ["SuiScroller is intended to operate with one child only."]
|
||||
|
|
|
@ -11,3 +11,9 @@ enum ScrollMode {
|
|||
MULTIPLY_CUSTOM_VALUE,
|
||||
CUSTOM_VALUE
|
||||
}
|
||||
enum ScrollDirection {
|
||||
UP,
|
||||
DOWN,
|
||||
LEFT,
|
||||
RIGHT
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue