-
-
Notifications
You must be signed in to change notification settings - Fork 105
MousePointer
Extends: Area2D
This handles the mouse pointer collision shape 2D interactions It is used for detecting when a card and its elements is being hovered As we cannot rely on Control node relevant signals due to Godot bugs such as:
const MOUSE_RADIUS: int = 2
The amount of radius in pixels that the mouse collision area
This const is sometimes looked-up by other nodes to determine their own properties
var current_focused_card: Card
The card that is currently highlighted as a result of this mouse cursor hovering over it.
var overlaps: Array
The card that is currently highlighted as a result of this mouse cursor hovering over it. The amount of cards the cursor is hovering. We're using our own Array instead of get_overlapping_areas() because those are updated every tick, which causes glitches when the player moves the mouse too fast.
Instead we populate according to signals,which are more immediate
var is_disabled: bool
-
Setter:
set_disabled
The card that is currently highlighted as a result of this mouse cursor hovering over it. The amount of cards the cursor is hovering. We're using our own Array instead of get_overlapping_areas() because those are updated every tick, which causes glitches when the player moves the mouse too fast.
Instead we populate according to signals,which are more immediate When set to false, prevents the player from disable interacting with the game.
func determine_global_mouse_pos() -> Vector2
We're using this helper function, to allow our mouse-position relevant code to work during integration testing Returns either the adjusted global mouse position or a fake mouse position provided by integration testing
func disable() -> void
Disables the mouse from interacting with the board
func enable() -> void
Re-enables the mouse interacting with the board
func forget_focus() -> void
func set_disabled(value) -> void