Skip to content

class_has_method

NikkoTC edited this page Sep 4, 2023 · 2 revisions

This function returns true if class has a given method.


Syntax

class_has_method(classID, methodName);
Argument Description
classID The unique class ID
methodName The method name as a string

Returns

Boolean


Example

if(class_has_method(MyClass, "load"))
{
	var inst = create(MyClass);
	inst.load(file);
	array_push(customAssets, inst);
}

The above code will check if MyClass has a method named load, then create an instance of the class and call that method.