Skip to content

Commit 0b45775

Browse files
committed
Add variable block to construct a Vector2 from X,Y
1 parent dd61f2b commit 0b45775

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

addons/block_code/ui/picker/categories/category_factory.gd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,13 @@ static func get_general_blocks() -> Array[Block]:
353353
b.category = "Variables"
354354
block_list.append(b)
355355

356+
b = BLOCKS["parameter_block"].instantiate()
357+
b.variant_type = TYPE_VECTOR2
358+
b.block_format = "Vector2 x: {x: FLOAT} y: {y: FLOAT}"
359+
b.statement = "Vector2({x}, {y})"
360+
b.category = "Variables"
361+
block_list.append(b)
362+
356363
#endregion
357364
#region Math
358365

0 commit comments

Comments
 (0)