melonJS
    Preparing search index...

    Function hasObjectFactory

    • Whether a class or a factory is registered under a name, by the game or by the engine (its own classes, such as Trigger or Light2d, are): what a level reader asks before createLevelObject, to tell an object the game has a class for from one it has to make something of by itself.

      With gameOnly, only what the game registered itself counts: not the engine's own classes, nor the fallbacks for an object with no class ("text", "tile", "shape"). For a format whose objects are named freely, where a name like "Trigger", "Text" or "Entity" is the designer's own word and not a request for the engine's class.

      Parameters

      • name: string

        a class or an object name

      • OptionalgameOnly: boolean = false

        count only what the game registered

      Returns boolean

      true if a class or a factory is registered for it