Comet Entrypoint
The comet
is the framework's single point of entry for setup.
import { Comet } from "@rbxts/comet";
Methods
createApp()
Must be called before all other methods or the system will error.
Creates and initializes the main app.
createApp(plugin: Plugin, name: String): void
registerSystem()
Registers a system for use in the framework. You must pass the class by reference, not by instance.
[v0.1] Currently, this is the only way to register systems.
registerSystem<T extends System>(system: Ref<T>): void
Example
In the below example, the class is defined in the main file for demonstration purposes. Ideally, you'd have your systems defined in seperate files.
import { Comet, System } from "@rbxts/comet";
// Example System
class MySystem implements System { }
Comet.createApp(plugin, "MyAwesomeApp")
Comet.registerSystem(MySystem)
// ...
launch()
Launches Comet and all registered systems.
registerSystem()
should not be invoked after launch. Doing so will cause an error.
Type
launch(): void
Example
We will re-use part of the above example to show how this method is used after all the others.
// ...
Comet.createApp(plugin, "MyAwesomeApp")
Comet.registerSystem(MySystem)
Comet.launch()
enableDebugging()
Enables verbose debugging of internal systems. For the best results, invoke this prior to launch()
.
enableDebugging(): void