Reputation: 2090
At the very first page of the reference manual of GDScript there is a learn GDscript in x minutes with a line of code which seems to be a macro @icon("path/to.png")
but that does not work on the latest version of Godot (v 3.3.stable.mono.official):
class_name Player
extends KinematicBody2D
@icon("res://icon.png")
func _ready() -> void:
pass
Parser Error: Parse error: Unexpected '@'
Upvotes: 1
Views: 911
Reputation: 40220
You are reading documentation for Godot 4.0 (look in the url, you want "stable" not "latest"). See also GDScript progress report: New GDScript is now merged.
In Godot 3.x to specify an script icon you do it in the class_name
statement, like this:
class_name Player, "res://icon.png"
See Register scripts as classes.
Upvotes: 2