Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Extends BaseButton functionality to distinguish
- # right and left mouse clicks.
- # So you can use this script with any type of button.
- extends BaseButton
- signal left_click
- signal right_click
- func _gui_input(event):
- if event is InputEventMouseButton and !event.pressed and get_rect().has_point(event.position):
- match event.button_index:
- BUTTON_LEFT:
- emit_signal("left_click")
- BUTTON_RIGHT:
- emit_signal("right_click")
Add Comment
Please, Sign In to add comment