system
1
system
4
|
|
|
|
Reply From: |
lukas |
Do you mean position of mouse input event?
func _input(event):
if event.type == 2 or event.type == 3:
# Mouse motion or mouse button event
var mouse_event_pos = event.pos
You can also use these constants for clarity:
if event.type == InputEvent.MOUSE_MOTION or event.type == InputEvent.MOUSE_BUTTON:
Zylann | 2016-03-13 22:41
Not only for clarity, since APIs tend to change over time…
Bojidar Marinov | 2016-03-14 10:28
system
5
|
|
|
|
Reply From: |
zendorf |
If you are creating a 2d game, you can get access to mouse x/y co-ordinates inside any function by using get_global_mouse_pos().
for example:
var mouse_pos = get_global_mouse_pos()
var mx = mouse_pos.x
var my = mouse_pos.y
This is the Most Helpful one, thanks ^^
The_Duskitty | 2016-03-15 01:28