gr_record_create

Syntax:

gr_record_create();

Returns: (Record) The new record instance

Description:

Creates a new record instance. A record, represents a User recorded gesture. Is composed by a set of points. The points are usually captured using a mouse, touchscreen, or another input device and then are shown on the screen. One record, can have multiple strokes. At least one stroke with two points are needed to be able to recognize any gesture.

Example:

// create
record = undefined;

// global mouse presed event
gr_record_destroy(record); // Destroy the previous gesture record
record = gr_record_create(); // And creates a new gesture record

// global mouse down event
if (record != undefined) {
gr_record_add_point(record, mouse_x, mouse_y);
}

// global mouse released event
if (record != undefined) {
result = gr_record_recognize(record);
// Then, do stuff with the result of the recognition
}