ScriptFunc.tscn 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. [gd_scene load_steps=6 format=3 uid="uid://b56og44flraar"]
  2. [ext_resource type="Script" path="res://addons/slide_show/projector/slide/Slide.gd" id="1_orknp"]
  3. [ext_resource type="Texture2D" uid="uid://3i6oj4q3qeam" path="res://slides/272/VisualShaderNodeFloatFunc.svg" id="2_kg7eu"]
  4. [ext_resource type="PackedScene" uid="uid://bvrtmyq4g1qes" path="res://common/components/title/title.tscn" id="3_erhoj"]
  5. [ext_resource type="PackedScene" uid="uid://b811jddpttnt4" path="res://common/components/subtitle/subtitle.tscn" id="5_g5ffp"]
  6. [sub_resource type="CodeHighlighter" id="CodeHighlighter_2654d"]
  7. number_color = Color(0.803922, 0, 0.803922, 1)
  8. symbol_color = Color(0, 0, 1, 1)
  9. function_color = Color(0, 0.615686, 0, 1)
  10. member_variable_color = Color(0.8, 0.5, 0, 1)
  11. keyword_colors = {
  12. "InputEvent": Color(0, 0.4, 0, 1),
  13. "RigidBody2D": Color(0, 0.4, 0, 1),
  14. "String": Color(0, 0.4, 0, 1),
  15. "Vector2": Color(0, 0.4, 0, 1),
  16. "and": Color(1, 0, 0, 1),
  17. "bool": Color(1, 0, 0, 1),
  18. "class": Color(1, 0, 0, 1),
  19. "class_name": Color(1, 0, 0, 1),
  20. "extends": Color(1, 0, 0, 1),
  21. "float": Color(1, 0, 0, 1),
  22. "for": Color(1, 0, 0, 1),
  23. "func": Color(1, 0, 0, 1),
  24. "if": Color(1, 0, 0, 1),
  25. "in": Color(1, 0, 0, 1),
  26. "int": Color(1, 0, 0, 1),
  27. "return": Color(1, 0, 0, 1),
  28. "signal": Color(1, 0, 0, 1),
  29. "var": Color(1, 0, 0, 1)
  30. }
  31. [node name="ScriptFunc" type="Node2D"]
  32. script = ExtResource("1_orknp")
  33. [node name="Sprite2D" type="Sprite2D" parent="."]
  34. position = Vector2(1607, 612)
  35. scale = Vector2(2, 2)
  36. texture = ExtResource("2_kg7eu")
  37. [node name="Title" parent="." instance=ExtResource("3_erhoj")]
  38. offset_left = 85.0
  39. offset_top = 26.0
  40. offset_right = 1847.0
  41. offset_bottom = 194.0
  42. text = "Les fonctions"
  43. [node name="GdScriptEdit" type="CodeEdit" parent="."]
  44. offset_left = 52.0
  45. offset_top = 207.0
  46. offset_right = 1346.0
  47. offset_bottom = 942.0
  48. theme_override_colors/background_color = Color(1, 1, 1, 1)
  49. theme_override_colors/font_color = Color(0, 0, 0, 1)
  50. theme_override_font_sizes/font_size = 46
  51. text = "func _ready():
  52. var penguin_speed: float = 40.0 # km/h
  53. penguin_speed = accelerate(penguin_speed)
  54. penguin_speed = accelerate(penguin_speed)
  55. print(\"Tux runs at \", penguin_speed)
  56. func accelerate(initial_speed: float) -> float:
  57. var new_speed: float = initial_speed + 2.0
  58. return new_speed"
  59. deselect_on_focus_loss_enabled = false
  60. virtual_keyboard_enabled = false
  61. syntax_highlighter = SubResource("CodeHighlighter_2654d")
  62. gutters_draw_line_numbers = true
  63. indent_use_spaces = true
  64. [node name="Subtitle" parent="." instance=ExtResource("5_g5ffp")]
  65. offset_left = 57.0
  66. offset_top = 952.0
  67. offset_right = 1326.0
  68. offset_bottom = 1083.0
  69. text = "Tux runs at 44"