Actionbars are now using built in control functionality for layout. Also Vsync is on now.

This commit is contained in:
Relintai 2019-12-07 19:01:34 +01:00
parent 0755ceb74d
commit 582f2298f2
5 changed files with 22 additions and 38 deletions

View File

@ -248,7 +248,6 @@ gdscript/warnings/integer_division=false
[display]
window/dpi/allow_hidpi=true
window/vsync/use_vsync=false
window/handheld/orientation="sensor_landscape"
window/stretch/mode="2d"
window/stretch/aspect="expand"

View File

@ -8,28 +8,10 @@ export (PackedScene) var action_bar_entry_scene
export (NodePath) var child_container_path
var child_container
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
child_container = get_node(child_container_path)
# pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func set_actionbar_entry(action_bar_entry : ActionBarEntry, player: Entity) -> void:
#rect_size = Vector2(action_bar_entry.size, (action_bar_entry.size) * action_bar_entry.slot_num)
#set_anchors_preset(Control.PRESET_BOTTOM_RIGHT, false)
#margin_left = action_bar_entry.action_bar_id * -(action_bar_entry.size + 5) - 10
margin_top = - ((action_bar_entry.size) * action_bar_entry.slot_num)
#margin_bottom = 0
margin_right = -((action_bar_entry.action_bar_id - 1) * action_bar_entry.size)
margin_left = -((action_bar_entry.action_bar_id) * action_bar_entry.size)
for i in range(action_bar_entry.slot_num):
var b : ActionBarButtonEntry = action_bar_entry.get_button_for_slotid(i)

View File

@ -3,14 +3,15 @@
[ext_resource path="res://ui/actionbars/ActionBarEntry.tscn" type="PackedScene" id=1]
[ext_resource path="res://ui/actionbars/ActionBar.gd" type="Script" id=2]
[node name="ActionBar" type="Control"]
[node name="ActionBar" type="VBoxContainer"]
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -63.0
margin_top = -580.0
margin_left = -40.0
margin_top = -553.0
mouse_filter = 2
custom_constants/separation = 0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
@ -18,13 +19,15 @@ __meta__ = {
action_bar_entry_scene = ExtResource( 1 )
child_container_path = NodePath("GridContainer")
[node name="GridContainer" type="GridContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
[node name="Control" type="Control" parent="."]
margin_right = 40.0
margin_bottom = 553.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="GridContainer" type="GridContainer" parent="."]
margin_top = 553.0
margin_right = 40.0
margin_bottom = 553.0
custom_constants/vseparation = 0
__meta__ = {
"_edit_use_anchors_": false
}
custom_constants/hseparation = 0

View File

@ -6,12 +6,10 @@
[ext_resource path="res://ui/theme/actionbar_dynamicfont.tres" type="DynamicFont" id=5]
[node name="ActionBarEntry" type="TouchButton"]
margin_top = 1.0
margin_right = 70.0
margin_bottom = 71.0
margin_right = 46.0
margin_bottom = 46.0
rect_min_size = Vector2( 46, 46 )
focus_mode = 0
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 3 )
shortcut_in_tooltip = false
action_mode = 0
@ -43,8 +41,8 @@ __meta__ = {
[node name="TextureRect" type="TextureRect" parent="MarginContainer"]
margin_left = 2.0
margin_top = 2.0
margin_right = 68.0
margin_bottom = 68.0
margin_right = 44.0
margin_bottom = 44.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3

View File

@ -319,15 +319,17 @@ enabled_focus_mode = 0
keep_pressed_outside = true
text = "M"
[node name="Actionbars" type="Control" parent="GUI"]
[node name="Actionbars" type="HBoxContainer" parent="GUI"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 0
alignment = 2
script = ExtResource( 8 )
__meta__ = {
"_edit_lock_": true
"_edit_use_anchors_": false
}
actionbar_scene = ExtResource( 14 )