Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Jorin G. | |
Old Version | Published before Godot 3 was released. |
I’m working on the GUI tutorial at docs.godotengine.org and have hit a snag. The error says “Identifier not found: ev_type” so I assume it’s not one found in GDScript. Here’s my code:
extends Control
var tapped = false
func _draw():
var r = Rect2( Vector2(), get_size() )
if (tapped):
draw_rect(r, Color(1,0,0) )
else:
draw_rect(r, Color(0,0,1) )
func _input_event(ev):
if (ev_type==InputEvent.MOUSE_BUTTON and ev.pressed):
tapped = true
update()