Skip to content

TargetingArrow

Divided by Zer0 edited this page Mar 9, 2022 · 5 revisions

TargetingArrow

Extends: Line2D

Description

Handles drawing an Object's (primarily a card's) targeting arrow and specifying the final target

Property Descriptions

is_targeting

var is_targeting: bool

We use this to track multiple potential target objects when our owner_card is about to target them. If true, the targeting arrow will be drawn towards the mouse cursor

target_object

var target_object: Node

We use this to track multiple potential target objects when our owner_card is about to target them. If true, the targeting arrow will be drawn towards the mouse cursor Used to store a card succesfully targeted. It should be cleared from whichever effect requires a target. once it is used

owner_object

var owner_object

We use this to track multiple potential target objects when our owner_card is about to target them. If true, the targeting arrow will be drawn towards the mouse cursor Used to store a card succesfully targeted. It should be cleared from whichever effect requires a target. once it is used Stores a reference to the Card that is hosting this node

Method Descriptions

initiate_targeting

func initiate_targeting() -> void

Will generate a targeting arrow on the card which will follow the mouse cursor. The top card hovered over by the mouse cursor will be highlighted and will become the target when complete_targeting() is called

complete_targeting

func complete_targeting() -> void

Will end the targeting process.

The top targetable object which is hovered (if any) will become the target and inserted into the target_object property for future use.

Signals

  • signal initiated_targeting(): Emitted whenever the object spawns a targeting arrow.
  • signal target_selected(target): Emitted whenever the object spawns a targeting arrow. Emitted whenever the object has selected a target.
  • signal potential_target_found(target): Emitted whenever the object spawns a targeting arrow. Emitted whenever the object has selected a target.
Clone this wiki locally