Skip to content

Enhancement: Rename init to scriptInit for creating scripted classes #241

@KoloInDaCrib

Description

@KoloInDaCrib

Currently, to init a scripted class, you have to run [ScriptedClass].init([name], [params]);. However, due to the name of this function and due to the fact that Haxe doesn't support having an instance and a static function with the same name, several classes that already have an init function of their own such as FlxSound cannot be made scriptable.

My proposed solution would be to rename the initialization function to scriptInit and to implement some sort of backwards compatibility to PolymodInterpEx. That way, not only is the problem of some classes not being possible to script avoided, but it would also follow the naming convention of other HScriptClassMacro methods (scriptGet, scriptSet, scriptCall).

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions