Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

Typedefs
Scripting Engine Callbacks
TorqueScript Bindings

## Typedefs
typedef const char *(* | StringCallback) (SimObject *obj, S32 argc, const char *argv[])
typedef S32(* | IntCallback) (SimObject *obj, S32 argc, const char *argv[])
typedef F32(* | FloatCallback) (SimObject *obj, S32 argc, const char *argv[])
typedef void(* | VoidCallback) (SimObject *obj, S32 argc, const char *argv[])
typedef bool(* | BoolCallback) (SimObject *obj, S32 argc, const char *argv[])
typedef void(* | ConsumerCallback) (ConsoleLogEntry::Level level, const char *consoleLine)

## Detailed Description

The scripting engine makes heavy use of callbacks to represent function exposed to the scripting language. StringCallback, IntCallback, FloatCallback, VoidCallback, and BoolCallback all represent exposed script functions returning different types.

ConsumerCallback is used with the function Con::addConsumer; functions registered with Con::addConsumer are called whenever something is outputted to the console. For instance, the TelnetConsole registers itself with the console so it can echo the console over the network.

Note
  Callbacks to the scripting language - for instance, onExit(), which is a script function called when the engine is shutting down - are handled using Con::executef() and kin.

## Typedef Documentation

typedef bool(* BoolCallback) (SimObject *obj, S32 argc, const char *argv[])

typedef void(* ConsumerCallback) (ConsoleLogEntry::Level level, const char *consoleLine)

typedef F32(* FloatCallback) (SimObject *obj, S32 argc, const char *argv[])

typedef S32(* IntCallback) (SimObject *obj, S32 argc, const char *argv[])

typedef const char*(* StringCallback) (SimObject *obj, S32 argc, const char *argv[])

typedef void(* VoidCallback) (SimObject *obj, S32 argc, const char *argv[])