Interface KiboomPluginInternal

The kiboom Kaboom's plugin

interface KiboomPlugin {
    children(childrens): EmptyComp;
    custom<T>(custom): Comp & T;
    extendMaker<TBaseComps, TBaseOpt, TNewComps, TNewOpt>(baseMaker, defaultOpt, componentsApply, baseDefaultOpt?): MakerFN<TNewOpt & TBaseOpt, TNewComps & TBaseComps>;
    kiScene<T>(name, def): (() => void);
    makeArea(opt): GameObj<BaseComps & AreaComp>;
    makeBg(opt?): GameObj<BaseComps & RenderComps & RectComp>;
    makeCircle(opt): GameObj<BaseComps & RenderComps>;
    makeMaker<TComps, TOpt>(defaultOpt, componentsApply): MakerFN<TOpt, TComps>;
    makeObject(opt): GameObj<BaseComps>;
    makeOptions<T>(opt): OptionFN<T>;
    makeRect(opt): GameObj<BaseComps & RenderComps & RectComp>;
    makeRender(opt?): GameObj<BaseComps & RenderComps>;
    makeSprite(opt): GameObj<BaseComps & RenderComps & SpriteComp>;
    makeText(opt): GameObj<BaseComps & RenderComps & TextComp>;
}

Object Makers - Object Makers

  • Make an object with a collider component. Maker extends makeObject

    Parameters

    Returns GameObj<BaseComps & AreaComp>

    Example

    const clickableArea = k.add(makeArea({
    width: 100,
    height: 100,
    }));
  • Make an object with the base components.

    Parameters

    Returns GameObj<BaseComps>

    Example

    // Good for parent objects!

    const myParent = k.add(makeObject({
    pos: k.vec2(100, 100),
    });

    myParent.add(k.makeSprite({
    sprite: "bean",
    }));

Methods

  • A component for define a childrens

    Parameters

    Returns EmptyComp

  • A component for define a custom component

    Type Parameters

    • T

    Parameters

    • custom: (() => T)
        • (): T
        • Returns T

    Returns Comp & T

  • Alpha

    Create an scene with an SceneManager

    In development

    Type Parameters

    • T extends {}

    Parameters

    • name: string
    • def: ((sceneData, ...args) => void)
        • (sceneData, ...args): void
        • Parameters

          • sceneData: SceneState<T>
          • Rest ...args: any[]

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Create a options object

    Type Parameters

    • T

    Parameters

    • opt: ((k) => Partial<T>)
        • (k): Partial<T>
        • Parameters

          • k: KaboomCtx

          Returns Partial<T>

    Returns OptionFN<T>

Base - Base

Generated using TypeDoc