# onStart

  • Property: onStart
  • Type: (engine: RpgClientEngine) => boolean | any
  • Optional: true
  • Usage:

When the engine is started. If you send false, you prevent the client from connecting to the server


# onStep

  • Property: onStep
  • Type: (engine: RpgClientEngine, t: number) => boolean | any
  • Optional: true
  • Usage:

Each frame


# onInput

  • Property: onInput
  • Type: (engine: RpgClientEngine, obj: { input: string, playerId: number }) => any
  • Optional: true
  • Usage:

Recover keys from the pressed keyboard


# onConnected

  • Property: onConnected
  • Type: (engine: RpgClientEngine, socket: any) => any
  • Optional: true
  • Usage:

Called when the user is connected to the server


# onDisconnect

  • Property: onDisconnect
  • Type: (engine: RpgClientEngine, reason: any, socket: any) => any
  • Optional: true
  • Usage:

Called when the user is disconnected to the server


# onConnectError

  • Property: onConnectError
  • Type: (engine: RpgClientEngine, err: any, socket: any) => any
  • Optional: true
  • Usage:

Called when there was a connection error


# onWindowResize

  • Since: 3.0.0-beta.4
  • Property: onWindowResize
  • Type: () => any
  • Optional: true
  • Usage:

Called when window is resized