Skip to content

Commit

Permalink
Add new value block: mouse_position
Browse files Browse the repository at this point in the history
Under category Input. Using the current node
CanvasItem.get_global_mouse_position() which considers viewport offset
and scale.

Fix #373
  • Loading branch information
manuq committed Feb 3, 2025
1 parent f29388d commit d55f2cf
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions addons/block_code/blocks/input/mouse_position.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://dwrdne76nxk7t"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_7vl3n"]

[resource]
script = ExtResource("1_7vl3n")
name = &"mouse_position"
target_node_class = "CanvasItem"
description = "The coordinates of the mouse position."
category = "Input"
type = 3
variant_type = 5
display_template = "mouse position"
code_template = "get_global_mouse_position()"
defaults = {}
signal_name = ""
is_advanced = false

0 comments on commit d55f2cf

Please sign in to comment.