Home Examples Background Targets
BeginnerComplex Visuals

Background Targets

Normally if you would like to show 10 targets on the screen at once you would have to send 10 VCodes at a time each cycle. This is not much of a problem, but now imagine you would like to show 30 targets at a time, this can be a bit cumbersome. The “show target in background” block helps get around this. A background target is one that is always shown in its “current” state until you send a new command that overrides the current state. Background VCodes are the same as normal VCodes except for 2 small things:
The target type is (normal target type + 100). i.e. a circle is 101.
There is an ID with the VCode that can be 1-1500. This is how you interact and change your permanent target states.

This sample task makes use of the “set target in background” block. The example protocol defines 30 targets of which 10 are shown at a time. When a target is touched its color changes. This is meant purely as an example of how to properly use background targets that are defined in your target table.

P.S. For some reason this task can take a very long time to compile (5+ minutes on my machine that normally takes 1-2 minutes to compile a task)

The task was last tested for Dexterit-E 3.10 and MATLAB 2015a SP1, 18-Aug-23.

Related Tasks

Coding Tips
Persistent Variables
Persistent variables are ones that hold their value between calls to the embedded MATLAB code they are defined in.
Coding Tips
Custom Control of the Trial Protocol Order
Normally, Dexterit-E manages and controls the order in which Trial Protocols (TPs) execute based on what is defined in the block table of the Task Protocol (see the Dexterit-E User Guide for more details).