Moved canvas indicator drawing to a new script

Cursor indicators now appear on top of the grid again
This commit is contained in:
OverloadedOrama 2020-08-18 16:35:05 +03:00
parent 92332cc52e
commit f2136236b1
4 changed files with 19 additions and 6 deletions

View file

@ -10,6 +10,7 @@ var cursor_image_has_changed := false
var sprite_changed_this_frame := false # for optimization purposes
onready var grid = $Grid
onready var indicators = $Indicators
# Called when the node enters the scene tree for the first time.
@ -44,10 +45,6 @@ func _draw() -> void:
draw_texture(current_cels[i].image_texture, Vector2(location.x + size.x, location.y), modulate_color) # Right
draw_texture(current_cels[i].image_texture, location + size, modulate_color) # Down right
# Draw rectangle to indicate the pixel currently being hovered on
if Global.has_focus and Global.can_draw:
Tools.draw_indicator()
func _input(event : InputEvent) -> void:
# Don't process anything below if the input isn't a mouse event, or Shift/Ctrl.