Skip to main content

Function Prototypes

Defines the function prototypes used for registering callbacks with the API.

Types

TypeName
typedef void(*)(int code, HNode user, void *userData)EventGestureFunc
Signature of a function that is called when a key code is changed (for event observers)
typedef void(*)(int code, int state, HNode user, void *userData)EventKeyFunc
Signature of a function that is called when a key state is changed (for event observers)
typedef void(*)(HNode node, HNode user, void *userData)EventNodeFunc
Signature of a function that is called when a node state is changed (for event observers)
typedef void(*)(HNode node, HNode other, void *userData)EventTwoNodesFunc
Signature of a function that is called when two nodes interact (for event observers)
typedef void(*)(HNode node, HNode other, HNode user, void *userData)EventTwoNodesUserFunc
Signature of a function that is called when two nodes interact (for event observers)
typedef HFFIVar(*)(int argc, HFFIVar *argv, void *userData)FFIFunc
Signature of a function that is exposed to the Lua environment.
typedef void(*)(HMigration m)MigrationAddFunc
Signature of a function that receives a new migration handle and should use it to register other callbacks.
typedef int(*)(HMigration m, HMeta meta)MigrationDownFunc
Signature of a function that should perform a downgrade on a metanode.
typedef HNode(*)(HMigration m, HNode node)MigrationDowngradeFunc
Signature of a function that should perform a downgrade on a node instance.
typedef void(*)(HNode node, void *userData)MigrationFunc
Signature of a function that is called at the end of a nodes migration calls.
typedef int(*)(HMigration m, HMeta meta)MigrationUpFunc
Signature of a function that should perform an upgrade on a metanode.
typedef HNode(*)(HMigration m, HNode node)MigrationUpgradeFunc
Signature of a function that should perform an upgrade on a node instance, e.g. by modifying property values.
typedef void(*)(HNode parent, HNode child, void *userData)NodeChildAddedFunc
Signature of a function that is called when a child is added to a node.
typedef void(*)(HNode parent, HNode child, void *userData)NodeChildRemovedFunc
Signature of a function that is called when a child is removed from a node.
typedef void(*)(HNode node, void *userData)NodeCreatedFunc
Signature of a function that is called when a node is created.
typedef void(*)(HNode node, void *userData)NodeDestroyingFunc
Signature of a function that is called when a node is about to be deleted.
typedef void(*)(HNode node, HNode newParent, HNode oldParent, void *userData)NodeParentChangedFunc
Signature of a function that is called when a node is moved to a new parent.
typedef void(*)(HNode node, void *userData)NodeRenamedFunc
Signature of a function that is called when a node is renamed.
typedef void(*)(HNode node, void *userData)NodeValuesChangedFunc
Signature of a function that is called when properties on a node are changed.
typedef void(*)(void *userData)ScriptEventFunc
Signature of a function that is called in response to a registered script event.
typedef void(*)(const char *path, void *userData)SettingChangedFunc
Signature of a function that is called when a setting is changed.
typedef void(*)(double deltaTime, void *userData)UpdateFunc
Signature of a function that is called every frame.

Types Documentation

typedef EventGestureFunc

typedef void(* EventGestureFunc) (int code, HNode user, void *userData);

Signature of a function that is called when a key code is changed (for event observers)

Parameters:

  • code key code
  • user user node copied from the __User LUA register
  • userData arbitrary user data that was provided when registering the callback

typedef EventKeyFunc

typedef void(* EventKeyFunc) (int code, int state, HNode user, void *userData);

Signature of a function that is called when a key state is changed (for event observers)

Parameters:

  • code key code
  • code key state
  • user user node copied from the __User LUA register
  • userData arbitrary user data that was provided when registering the callback

typedef EventNodeFunc

typedef void(* EventNodeFunc) (HNode node, HNode user, void *userData);

Signature of a function that is called when a node state is changed (for event observers)

Parameters:

  • node node which state is changed
  • user user node copied from the __User LUA register
  • userData arbitrary user data that was provided when registering the callback

typedef EventTwoNodesFunc

typedef void(* EventTwoNodesFunc) (HNode node, HNode other, void *userData);

Signature of a function that is called when two nodes interact (for event observers)

Parameters:

  • node node which state is changed
  • other interacting node copied from the __Other LUA register
  • userData arbitrary user data that was provided when registering the callback

typedef EventTwoNodesUserFunc

typedef void(* EventTwoNodesUserFunc) (HNode node, HNode other, HNode user, void *userData);

Signature of a function that is called when two nodes interact (for event observers)

Parameters:

  • node node which state is changed
  • other interacting node copied from the __Other LUA register
  • user user node copied from the __User LUA register
  • userData arbitrary user data that was provided when registering the callback

typedef FFIFunc

typedef HFFIVar(* FFIFunc) (int argc, HFFIVar *argv, void *userData);

Signature of a function that is exposed to the Lua environment.

typedef MigrationAddFunc

typedef void(* MigrationAddFunc) (HMigration m);

Signature of a function that receives a new migration handle and should use it to register other callbacks.

Parameters:

  • m handle to a migration

typedef MigrationDownFunc

typedef int(* MigrationDownFunc) (HMigration m, HMeta meta);

Signature of a function that should perform a downgrade on a metanode.

Parameters:

  • m the migration that owns this downgradfe function
  • meta the metanode that should be modified as part of the downgrade

Return: should return zero on success

typedef MigrationDowngradeFunc

typedef HNode(* MigrationDowngradeFunc) (HMigration m, HNode node);

Signature of a function that should perform a downgrade on a node instance.

Parameters:

  • m the migration that owns this upgrade function
  • node the node instance to downgrade

Return: a node handle representing the new, downgraded node instance

typedef MigrationFunc

typedef void(* MigrationFunc) (HNode node, void *userData);

Signature of a function that is called at the end of a nodes migration calls.

Parameters:

  • node the node that you are migrating
  • userData arbitrary user data that was provided when registering the callback

typedef MigrationUpFunc

typedef int(* MigrationUpFunc) (HMigration m, HMeta meta);

Signature of a function that should perform an upgrade on a metanode.

Parameters:

  • m the migration that owns this upgrade function
  • meta the metanode that should be modified as part of the upgrade

Return: should return zero on success

typedef MigrationUpgradeFunc

typedef HNode(* MigrationUpgradeFunc) (HMigration m, HNode node);

Signature of a function that should perform an upgrade on a node instance, e.g. by modifying property values.

Parameters:

  • m the migration that owns this upgrade function
  • node the node instance to upgrade

Return: a node handle representing the new, upgraded node instance

typedef NodeChildAddedFunc

typedef void(* NodeChildAddedFunc) (HNode parent, HNode child, void *userData);

Signature of a function that is called when a child is added to a node.

Parameters:

  • parent the parent node
  • child the child that is being added to the parent
  • userData arbitrary user data that was provided when registering the callback

typedef NodeChildRemovedFunc

typedef void(* NodeChildRemovedFunc) (HNode parent, HNode child, void *userData);

Signature of a function that is called when a child is removed from a node.

Parameters:

  • parent the parent node
  • child the child that was removed from the parent
  • userData arbitrary user data that was provided when registering the callback

typedef NodeCreatedFunc

typedef void(* NodeCreatedFunc) (HNode node, void *userData);

Signature of a function that is called when a node is created.

Parameters:

  • node the node that was created
  • userData arbitrary user data that was provided when registering the callback

typedef NodeDestroyingFunc

typedef void(* NodeDestroyingFunc) (HNode node, void *userData);

Signature of a function that is called when a node is about to be deleted.

Parameters:

  • node the node that is about the be deleted
  • userData arbitrary user data that was provided when registering the callback

typedef NodeParentChangedFunc

typedef void(* NodeParentChangedFunc) (HNode node, HNode newParent, HNode oldParent, void *userData);

Signature of a function that is called when a node is moved to a new parent.

Parameters:

  • node the node that was moved
  • newParent the new parent of the node
  • oldParent the old parent that the node was moved from
  • userData arbitrary user data that was provided when registering the callback

typedef NodeRenamedFunc

typedef void(* NodeRenamedFunc) (HNode node, void *userData);

Signature of a function that is called when a node is renamed.

Parameters:

  • node the node that was created
  • userData arbitrary user data that was provided when registering the callback

typedef NodeValuesChangedFunc

typedef void(* NodeValuesChangedFunc) (HNode node, void *userData);

Signature of a function that is called when properties on a node are changed.

Parameters:

  • node the node that was modified
  • userData arbitrary user data that was provided when registering the callback

typedef ScriptEventFunc

typedef void(* ScriptEventFunc) (void *userData);

Signature of a function that is called in response to a registered script event.

Parameters:

  • userData arbitrary user data that was provided when registering the callback

typedef SettingChangedFunc

typedef void(* SettingChangedFunc) (const char *path, void *userData);

Signature of a function that is called when a setting is changed.

Parameters:

  • path the path to the setting from the root of the settings hierarchy
  • userData arbitrary user data that was provided when registering the callback

typedef UpdateFunc

typedef void(* UpdateFunc) (double deltaTime, void *userData);

Signature of a function that is called every frame.

Parameters:

  • deltaTime the time (in seconds) since the last frame
  • userData arbitrary user data that was provided when registering the callback