API registry module

Argument checking for the whole of trx.

Functions

  • trx.api.strict(enabled)
    Turns argument checking on or off for every function in trx, and for the methods on its handles. Off by default: checking costs a couple of hundred nanoseconds a call, which a per-frame handler notices. Turn it on while writing a level, and leave it off in play.

    Parameters:

    • enabled (boolean). Whether to check.

    Example:

    trx.api.strict(true)
    
  • trx.api.is_strict()
    Whether argument checking is on.

    Returns: boolean. False as the game starts, and true once something turns it on.