blob: 2828124688c22c89a0f208669554720242e032a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
[gd_scene load_steps=2 format=3 uid="uid://coqpusufa8a6k"]
[sub_resource type="GDScript" id="GDScript_10f85"]
script/source = "extends CenterContainer
@export_category(\"Reticle\")
@export_group(\"Nodes\")
@export var character : CharacterBody3D
@export_group(\"Settings\")
@export var dot_size : int = 1
@export var dot_color : Color = Color.WHITE
func _process(_delta):
if visible: # If the reticle is disabled (not visible), don't bother updating it
update_reticle_settings()
func update_reticle_settings():
$dot.scale.x = dot_size
$dot.scale.y = dot_size
$dot.color = dot_color
"
[node name="Reticle" type="CenterContainer"]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2
script = SubResource("GDScript_10f85")
[node name="dot" type="Polygon2D" parent="."]
polygon = PackedVector2Array(-1, -1, 1, -1, 1, 1, -1, 1)
|