Exposing abstracts in Hscript - inky03/hscript-insanity GitHub Wiki

To make an abstract usable in Hscript, include the following metadata in the declaration:

@:build(insanity.macro.AbstractMacro.build())
abstract MyAbstract(Blah) {} // your abstract code here

You can apply this to abstracts from external libraries with Compiler.addMetadata or Compiler.addGlobalMetadata. Once applied, the abstract can be imported and used in scripts!

See the Working with abstracts page to learn how to use them, and for Hscript specific limitations.

You can get a map with every scriptable abstract info in insanity.backend.types.Abstract.AbstractTools.abstractInfos.

[!NOTE] As of current testing, all abstracts in Flixel, OpenFL and Lime can be included in Hscript without errors. If you find any errors, you can report an issue.