gr_gesture_create(name, gesture_data_type, points_data);
Argument name Type Description
name string The name of the gesture. You can create multiple gestures with the same name.
gesture_data_type string A string that specify the type of data provided in points_data argument. It can be "path", "array_path", "array_points", "array_raw", "list_points" or "list_raw".
points_data array|list|path The data that will be determinate the points of the path.

Returns: (Gesture) The new created gesture


Creates a gesture with the specified name ussing the points_data specified. Note: if you want to add the gesture to the recognition system you must use gr_add instead. You can use one of the following strings in the data_type argument to create you gesture:

  • "path": Points_data must be a game maker path.
  • "array_path": Points_data must be an array with multiple paths inside. You can add a different path for each stroke. So if you pass an array with 4 elements, 4 different strokes will be added to that gesture.
  • "array_points": Points_data must be an array of points. You can create a point with gr_point_create(x, y, stroke)
  • "array_raw": Points_data must be an array with the point data. It must have the following format: [x1, y1, stroke1, x2, y2, stroke2, … , xN, yN, strokeN] where x and y are the coordinates of the point and stroke is the index of the stroke starting from zero.
  • "list_points": The same as "array_points", but with a ds_list of points.
  • "list_raw": The same as "array_raw", but with a ds_lists.

Warning, if you pass a ds_list as the points_data argument, the gesture will be created and the list will be destroyed.