Arrow Object
The Arrow object draws a straight arrow on a canvas frame. It is a ready-made Line with an Open arrow head at its end, so every Line setting applies to it. Use it for directional cues, pointers and instructions that need to stay sharp at any size and change direction per condition.
Table of Contents
Adding the Arrow Object
In the task editor toolbar, open the Images & Drawing group and select Arrow to add an Arrow object to the current frame.
A new arrow is 200 long with a head width of 20, a black stroke 2 wide, no start head and an Open arrow end head. As on a line, X and Y are the start point, Width is the length, Height is the head width and Rotation is the direction. See How the Box Defines the Line.
Shapes can be added to canvas frames. The Images & Drawing group is not offered on page frames or website frames.
Object Properties
All settings below are found in the properties panel when the Arrow is selected. They appear in the shape's own section, under a header with the shape's name.
Arrow settings
| Property | Default | Description |
|---|---|---|
Stroke width | 2 | Width of the line in frame units. 0 draws no line. |
Stroke color | Black | Color of the line and of the heads. |
Fill | Off | A checkbox plus a color picker. It colors the inside of the outlined heads only. |
Hit margin | 10 | An extra band around the hit area, in frame units. See Hit Area and Hit Margin. |
Start head | None | The head at the start point. |
End head | Open arrow | The head at the end point. |
Swap heads | A button that exchanges the start head and the end head. | |
Head length | 1 | Length of the heads as a multiple of the arrow's Height (× Height). |
Endpoints | Start X, Start Y, End X and End Y in frame coordinates. |
The head styles are None, Open arrow, Filled arrow, Triangle (outline), Circle, Circle (outline), Square, Bar and Diamond. The Line Object page describes each one.
Like other object properties, each setting can differ per trial type, and a value that differs from the default is shown with a dark gray background.
Style
Visibility works as for any other object. The generic Scaling, Border-Size, Border-Color, BG-Color, Transparent, Roundness, Overflow-X, Overflow-Y and Scroll Margin settings are hidden for shapes. Use Stroke color and Fill instead. The Anchor selector is hidden too, because an arrow is always anchored at its start point.
Custom CSS
The Change CSS Properties option works as for other objects. See Object Properties.
Changing the Direction
Change the direction of an arrow in either of two ways:
- Click
Swap heads. The arrow stays in the same place and points the other way. - Set
Rotationto turn the whole arrow around its start point.
Both settings can differ per trial type, so a single arrow object can point left in one condition and right in another without changing its position.
Hit Area and Hit Margin
The hit area of an Arrow is the stroke band of the line and its heads. An arrow starts with a Hit margin of 10 because a thin line is hard to hit. The margin widens the hit area by the given number of frame units on every side and is invisible to participants.
The same region is used for mouse triggers in the player and for Eyetracking Gaze and Eyetracking Fixation triggers that are limited to target objects.
Events Integration
The Arrow can be the target of the general object triggers. Common examples:
Mouse: react to aClick,PressDown,PressUp,Hover,LeaveorMoveon the object, measured against its hit area.Eyetracking GazeandEyetracking Fixation: limit the trigger to the arrow as a target to react when gaze or a fixation lands in its hit area. See the Eyetracking Fixation Trigger and Eyetracking Gaze Trigger pages.
To change an arrow while the experiment runs, use the Set Object Property Action. The properties are Stroke color, Stroke width, Fill, Fill color, Hit margin, Start head, End head, Head length, Start X, Start Y, End X and End Y, plus the box values X, Y, Width, Height, Rotation and Visibility. Start head and End head take the head style as a short id, for example openArrow, filledArrow or none. Use the id, not the name shown in the picker.
Example: reverse the arrow when a key is pressed
Trigger:
Keyboard→Set Target: your key
Action 1:Set Object Property→Set Target: your Arrow →Start head→openArrow
Action 2:Set Object Property→Set Target: your Arrow →End head→none
Example: Arrow Cue before a Target
A central arrow cue that points left or right, as in a cueing task:
- Add a Fixation Target in the center of the first frame.
- On the cue frame, add an
Arrowin the center. SetStroke widthto4andEnd headtoFilled arrow. - Add a factor with the levels
leftandright. Keep the arrow as it is for therightcondition. - For the
leftcondition, select it inTrials & Conditionsand setStart headtoFilled arrowandEnd headtoNone, or clickSwap heads. The arrow stays in the same place and points the other way, so no position changes per condition. - On the target frame, add two Rectangle objects as placeholders with
Filloff, and record the response with aMouseorKeyboardtrigger.
Further Reading
Object Properties
The properties panel all objects share, including the shape settings for stroke, fill and hit margin.
Set Object Property Action
Change the heads, rotation or stroke of an arrow while the experiment runs.
All Objects
A full index of all objects available in the Labvanced experiment editor, including display, input, media, and recording elements.