Quellcode durchsuchen

Add a colored button in the HUD

Using tile set.
DricomDragon vor 5 Jahren
Ursprung
Commit
fb556858f3
2 geänderte Dateien mit 62 neuen und 1 gelöschten Zeilen
  1. 28 1
      HUD.tscn
  2. 34 0
      dodge_assets/art/map_set.png.import

+ 28 - 1
HUD.tscn

@@ -1,6 +1,7 @@
-[gd_scene load_steps=10 format=2]
+[gd_scene load_steps=14 format=2]
 
 [ext_resource path="res://HUD.gd" type="Script" id=1]
+[ext_resource path="res://dodge_assets/art/map_set.png" type="Texture" id=2]
 
 [sub_resource type="DynamicFontData" id=1]
 font_path = "res://dodge_assets/fonts/Xolonium-Regular.ttf"
@@ -31,6 +32,21 @@ action = "ui_select"
 [sub_resource type="ShortCut" id=8]
 shortcut = SubResource( 7 )
 
+[sub_resource type="AtlasTexture" id=9]
+flags = 4
+atlas = ExtResource( 2 )
+region = Rect2( 16, 1865, 914, 471 )
+
+[sub_resource type="AtlasTexture" id=10]
+flags = 4
+atlas = ExtResource( 2 )
+region = Rect2( -1, 1275, 915, 471 )
+
+[sub_resource type="AtlasTexture" id=11]
+flags = 4
+atlas = ExtResource( 2 )
+region = Rect2( 1073, 1283, 914, 472 )
+
 [node name="HUD" type="CanvasLayer"]
 script = ExtResource( 1 )
 
@@ -68,5 +84,16 @@ text = "Start"
 [node name="MessageTimer" type="Timer" parent="."]
 wait_time = 2.15
 one_shot = true
+
+[node name="ColorButton" type="TextureButton" parent="."]
+margin_left = 160.073
+margin_top = 629.419
+margin_right = 322.073
+margin_bottom = 714.419
+texture_normal = SubResource( 9 )
+texture_pressed = SubResource( 10 )
+texture_hover = SubResource( 11 )
+expand = true
+stretch_mode = 4
 [connection signal="pressed" from="StartButton" to="." method="_on_StartButton_pressed"]
 [connection signal="timeout" from="MessageTimer" to="." method="_on_MessageTimer_timeout"]

+ 34 - 0
dodge_assets/art/map_set.png.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/map_set.png-dec2eab27aca15ce5b50ac1df0947369.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://dodge_assets/art/map_set.png"
+dest_files=[ "res://.import/map_set.png-dec2eab27aca15ce5b50ac1df0947369.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=1.0