The EyeTribe eye tracking for GameMaker
A downloadable extension for Windows
A minimal implementation of The EyeTribe's JSON-over-TCP eye tracker API.
- eyet_init(url, port, data_script, async = false, async_connect_script)
Initializes the connection to the eye tracker server.
By default, the server is accessible at "localhost" and port 6555.
data_script will be called (via script_execute) with (map, json_string) arguments whenever the server returns another complete line of JSON.
async should be set to true if you are using network_config_use_non_blocking_socket. Otherwise the function connects synchronously and returns whether successful.
If async is set to true, async_connect_script can be provided and will be called with (success) argument once the connection succeeds or fails.
A global variable indicating whether the connection to the eye tracker is currently active.
Should be called in Step event. Sends "heartbeat" packets to prevent the server from kicking you out for inactivity.
Should be called in Async - Network event. Accumulates JSON data and calls your "data" script zero or more times.
- eyet_send(json_string or ds_map)
Sends a JSON string (directly or a json_encode of a map) to the server.
If you want to use any additional endpoints, this is how you do that.
A global variable holding a snippet of JSON that will be sent to the server upon connecting. By default, this subscribes to receiving gaze data.
The example project demonstrates the flow to display gaze data and convert screen-space gaze coordinates to in-game coordinates.
Click download now to get access to the following files:
theeyetribe.gmz 17 kB
theeyetribe.zip 2 MB
Log in with itch.io to leave a comment.
Is this for Game Maker 8
Interacting with their API requires TCP sockets and JSON, neither of which are things that GM8 has out of box.
Now I can play my game without moving a muscle. The future is here.