jecs/docs/api.md
EncodedVenom 8e9225772b
Start Work on Documentation (#74)
* init bug / feat templates

* capital J for style

* PR templates

* Combine templates because github be like that

* Out with the old

* package and package lock files

* Deploy docs workflow

* Absolutely massive commit (docs)

* Delete cache and add to gitignore

* Goodbye cache
2024-07-14 01:06:50 +02:00

886 B

API

World

World.new() -> World

Creates a new world.

Example: ::: code-group

local world = jecs.World.new()
import { World } from "@rbxts/jecs";

const world = new World();

:::

world:entity() -> Entity<T>

Creates a new entity.

Example: ::: code-group

local entity = world:entity()
const entity = world.entity();

:::

world:component() -> Entity<T>

Creates a new static component. Keep in mind that components are also entities.

Example: ::: code-group

local Health = world:component()
const Health = world.component<number>();

:::

::: info You should use this when creating static components.

For example, a generic Health entity should be created using this. :::