Methods
(static) frame(S)
- Description:
Record a given frame. Should be used in event-driven scenarios (not using onFrame ticking)
- Source:
Example
Kapto.frame({
time: <myclock>,
x: <my_sample_xvalue>,
y: <my_sample_yvalue>
});
Parameters:
| Name | Type | Description |
|---|---|---|
S |
Object | State |
(static) getHubServer() → {String}
Returns:
addr - Hub address
- Type
- String
(static) isRecording()
(static) setActorName(actor)
Parameters:
| Name | Type | Description |
|---|---|---|
actor |
String | friendly name for object we are currently tracking |
(static) setDataChunkSize(size)
Parameters:
| Name | Type | Description |
|---|---|---|
size |
Number | Number of frames per packet |
(static) setGroupID(gid)
Parameters:
| Name | Type | Description |
|---|---|---|
gid |
String | group ID (e.g.: "experiment1", "scene3") |
(static) setHubServer(addr)
Parameters:
| Name | Type | Description |
|---|---|---|
addr |
String | address (IP or domain) |
(static) setOnDataChunk(of)
Example
Kapto.setOnDataChunk((data)=>{
console.log(data);
});
Parameters:
| Name | Type | Description |
|---|---|---|
of |
function | onDataChunk routine to execute when a datachunk is sent |
(static) setOnFrame(of)
Example
Kapto.setOnFrame(()=>{
return {
x: <my_sample_xvalue>,
y: <my_sample_yvalue>
}
});
Parameters:
| Name | Type | Description |
|---|---|---|
of |
function | onFrame routine producing a state (object) each tick |
(static) setOnSessionID(of)
Example
Kapto.setOnSessionID((sesid)=>{
console.log(sesid);
});
Parameters:
| Name | Type | Description |
|---|---|---|
of |
function | onSessionID routine to execute on ID assigned |
(static) start(interval)
Parameters:
| Name | Type | Description |
|---|---|---|
interval |
Number | Time interval (milliseconds) |