Skip to content

Commit 9e4a462

Browse files
committed
blocks: Add vector_from_angle and vector_multiply blocks
1 parent c00ec59 commit 9e4a462

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://c7a6wnxegkfd5"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_1p1ve"]
4+
5+
[resource]
6+
script = ExtResource("1_1p1ve")
7+
name = &"from_angle"
8+
target_node_class = ""
9+
description = "Creates a unit Vector2 rotated to the given angle in radians."
10+
category = "Math"
11+
type = 3
12+
variant_type = 5
13+
display_template = "vector from {angle: FLOAT}"
14+
code_template = "Vector2.from_angle({angle})"
15+
defaults = {}
16+
signal_name = ""
17+
scope = ""
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://bff7cwmpisihj"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_52jwf"]
4+
5+
[resource]
6+
script = ExtResource("1_52jwf")
7+
name = &"vector_multiply"
8+
target_node_class = ""
9+
description = "Multiplies a vector with a number. Use this, for example, to get a point some distance away along an angle."
10+
category = "Math"
11+
type = 3
12+
variant_type = 5
13+
display_template = "multiply {vector: VECTOR2} by {number: FLOAT}"
14+
code_template = "{vector} * {number}"
15+
defaults = {
16+
"number": 1.0,
17+
"vector": Vector2(1, 1)
18+
}
19+
signal_name = ""
20+
scope = ""

0 commit comments

Comments
 (0)