My Projects
💫 Comet
API
Comet

Comet Entrypoint

The comet is the framework's single point of entry for setup.

Import
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.

Type
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.

Type
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.

Usage
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

Type
launch(): void

Example

We will re-use part of the above example to show how this method is used after all the others.

Usage
// ...
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().

Type
enableDebugging(): void