Button.tscn 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. [gd_scene load_steps=7 format=2]
  2. [ext_resource path="res://ui/TouchScreenButton.gd" type="Script" id=1]
  3. [ext_resource path="res://icon.png" type="Texture" id=2]
  4. [ext_resource path="res://sounds/sfx1.ogg" type="AudioStream" id=3]
  5. [ext_resource path="res://newdynamicfont.tres" type="DynamicFont" id=4]
  6. [ext_resource path="res://sounds/sfx2.ogg" type="AudioStream" id=5]
  7. [sub_resource type="RectangleShape2D" id=1]
  8. [node name="Button" type="TouchScreenButton"]
  9. normal = ExtResource( 2 )
  10. script = ExtResource( 1 )
  11. [node name="Button" type="Button" parent="."]
  12. margin_right = 63.0
  13. margin_bottom = 66.0
  14. flat = true
  15. [node name="Label" type="Label" parent="."]
  16. margin_left = -275.0
  17. margin_top = 1.0
  18. margin_right = -6.0
  19. margin_bottom = 61.0
  20. custom_fonts/font = ExtResource( 4 )
  21. text = "stuff"
  22. align = 1
  23. valign = 1
  24. [node name="ColorRect" type="ColorRect" parent="Label"]
  25. show_behind_parent = true
  26. anchor_right = 1.0
  27. anchor_bottom = 1.0
  28. margin_right = 1.0
  29. color = Color( 0, 0, 0, 0.321569 )
  30. [node name="col" type="Area2D" parent="."]
  31. collision_layer = 0
  32. collision_mask = 0
  33. [node name="CollisionShape2D" type="CollisionShape2D" parent="col"]
  34. position = Vector2( 32, 32 )
  35. shape = SubResource( 1 )
  36. [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
  37. stream = ExtResource( 3 )
  38. bus = "menu"
  39. [node name="AudioStreamPlayer2" type="AudioStreamPlayer" parent="."]
  40. stream = ExtResource( 5 )
  41. bus = "menu"
  42. [connection signal="pressed" from="." to="AudioStreamPlayer" method="play"]
  43. [connection signal="released" from="." to="AudioStreamPlayer2" method="play"]
  44. [connection signal="mouse_entered" from="Button" to="." method="_on_Button_mouse_entered"]
  45. [connection signal="mouse_exited" from="Button" to="." method="_on_Button_mouse_exited"]