Options
All
  • Public
  • Public/Protected
  • All
Menu

gl-tiled

Index

Type aliases

IDictionary

IDictionary<T>: Partial<{}>

Type parameters

  • T

ILayer

IObject

IProperty

TErrorEventCallback

TErrorEventCallback<T>: (error: ErrorEvent | null, arg: T) => void

Type parameters

  • T

Type declaration

    • (error: ErrorEvent | null, arg: T): void
    • Parameters

      • error: ErrorEvent | null
      • arg: T

      Returns void

TGLLayer

Functions

ASSERT

  • ASSERT(bool: boolean, message: string, data?: any): void
  • Asserts that some condition is true. If it is not, an error is logged and the debugger will break.

    memberof

    debug

    Parameters

    • bool: boolean

      The condition to ensure is true.

    • message: string

      The message to display if the first param is not true.

    • Optional data: any

      Extra data to log.

    Returns void

VALIDATE

  • VALIDATE(bool: boolean, message: string, data?: any): void
  • Validates that some condition is true. if it is not, a warning is logged.

    memberof

    debug

    Parameters

    • bool: boolean

      The condition to ensure is true.

    • message: string

      The message to display if the first param is not true.

    • Optional data: any

      Extra data to log.

    Returns void

assertNever

  • assertNever(x: never): never

hasOwnKey

  • hasOwnKey<O>(obj: O, key: string | number | symbol): key is keyof O
  • Type parameters

    • O

    Parameters

    • obj: O
    • key: string | number | symbol

    Returns key is keyof O

loadImage

parseColorStr

  • parseColorStr(colorStr: string, outColor: Float32Array): void

tiledMiddlewareFactory

  • tiledMiddlewareFactory(): tiledMiddleware
  • Creates the tiled loader middleware function and returns it.

    example

    const loader = new Loader();

    // add this middleware so that any map files we load will also have all their sub resources // loaded too. loader.use(glTiled['resource-loader'].tiledMiddlewareFactory()); loader.add('lightworld', 'maps/lttp/lightworld/lightworld.json'); loader.load(function () { // create the tilemap using the loaded map data (resources.lightworld.data) and passing // all resources as the third parameter which is the resource cache the Tilemap object // will search for map resources in before trying to load them itself. var tilemap = new glTiled.Tilemap(gl, loader.resources.lightworld.data, loader.resources); })

    Returns tiledMiddleware

Generated using TypeDoc