asset_get_tags

With this function you can retrieve all the tags assigned to an asset from the Asset Browser. You supply either the asset name (as a string) or it's asset index, and the function will return an array of tags for that asset. If no tags are found or there is an error (ie: the name string given doesn't exist) then the returned array will be empty. If you supply an asset index value, then you will need to supply the optional asset type argument (a constant), as assets of different types can have the same index, even though they cannot have the same name. The available asset types are listed in the table below:

 

 

Constant Description
asset_object The given name refers to an object.
asset_sprite The given name refers to a sprite.
asset_sound The given name refers to a sound.
asset_room The given name refers to a room.
asset_tiles The given name refers to a tile set.
asset_path The given name refers to a path.
asset_script The given name refers to a script.
asset_font The given name refers to a font.
asset_timeline The given name refers to a time line.
asset_shader The given name refers to a shader.
asset_animationcurve The given name refers to an Animation Curve.
asset_sequence The given name refers to a Sequence.

 

Syntax:

asset_get_tags(name_or_index, [asset_type]);

Argument Description
name_or_index The name of the asset (a string) or its index value (an integer).
[asset_type] OPTIONAL! The type of asset to het the tags for, only used when supplying an index for the first argument.

 

Returns:

Array

 

Example:

my_tags = asset_get_tags(object_get_name(object_index));

The above code will retrieve all the tags assigned to the object that the instance running the code has been created from.