[sample_bin, quit] = drawFunc_object(window, last_sample, draw_args, trial_bin, sample_bin)
DRAWFUNC_OBJECT is an advanced use of draw_func that is written to be paired with inputFunc_object and powered by easyScale, but that can also be used to draw still object distributions with other functions such as easyKeys.
The current draw_func takes the standard form required by easyScale. It draws upon a respmap to obtain information about the objects and their positions, and draws upon information in trial_bin to learn about the desired background. The parameters that are fed to this function by easyScale are as follows: window: token for the window where the bar plot should be drawn. last_sample: matrix with recent history of responses (with arbitrary dimensionality of [n m], where n is any number of samples and m scales along with the number of included objects (please see inputFunc_object for information about the expected [m 5+2n] structure of each sample). Note that only the most recent sample (i.e., the bottom one) is used for drawing objects. draw_args: parameters set by the calling experiment used to control the behaviour of this draw_func. 1: canvas_rect: a four-element rect [min_x min_y max_x max_y] describing the portion of the screen bounding the object area. 2: use_OS_cursor: a boolean. When true, the native OS cursor will be drawn; when false, a custom cursor will be drawn. 3: intensity threshold at which images are made transparent trial_bin: the trial_bin is a cell array containing trial-specific information. DRAWFUNC_OBJECT uses the following element positions: 1: a filename pointing to a custom cursor (if called for in draw_args). 2: a filename pointing to a custom background image (if desired). 4: instructions to be printed to the screen. Should be provided as a cell array with the following elements: 1: instruction string 2: wrapat property for drawing of string 3: the four-element rect describing where the instructions should be drawn. sample_bin: the sample_bin is a two-element cell array containing sample-specific information. By convention, the first element is written to by input_funcs and the second written to by draw_funcs. DRAWFUNC_OBJECT does not write new information to the sample_bin, but uses the following information from the first element: 1: a respmap describing the positions of various objects, as discussed in inputFunc_object. 3: the object "stack" describing the order in which objects have been recently selected. Objects will be drawn in the order of this stack, i.e., with the most recently selected objects on top. DRAWFUNC_OBJECT also returns sample_bin and quit as output, because these are required by easyScale. However, sample_bin is simply returned as it was provided in the input_args, and quit is a boolean that is always false.
For example usage of DRAWFUNC_OBJECT, please see demoEasyScale_drag.