Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Neji |
Hello guys, im new to godot and im little helpless with my problem here…
So Iv’e made a UI Node which is set to “Full Rect” and added a Label on the Top-Left of the UI as you can see here:
Now I have a Camera-Script that makes my Camera able to drag around… so since the UI Node is a child of the Camera it gets dragged around as well which is a litte unfortunate
This is the Camera-Script
extends Camera2D
var _previousPosition: Vector2 = Vector2(0, 0)
var _moveCamera: bool = false
func _unhandled_input(event: InputEvent):
if event is InputEventMouseButton && event.button_index == BUTTON_LEFT:
if event.is_pressed():
_previousPosition = event.position
_moveCamera = true
else:
_moveCamera = false;
elif event is InputEventMouseMotion && _moveCamera:
position += (_previousPosition - event.position)
_previousPosition = event.position
Any ideas how i can fix this problem?
Use CanvasLayer node for UI.
Kirson | 2019-11-06 01:19