Identifier not found: ev_type

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Jorin G.
:warning: 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()
:bust_in_silhouette: Reply From: volzhs

I can see ev_type in your code.

if (ev_type==InputEvent.MOUSE_BUTTON and ev.pressed):

change ev_type to ev.type

That did the trick. Thank you!

Jorin G. | 2017-09-21 21:47