Create geometric (vector) shapes by defining vertex locations.
Shapes can be outlines or filled, by setting lineRGB and fillRGB to rgb triplets, or None. They can also be rotated (stim.setOri(__)) and translated (stim.setPos(__)) like any other stimulus.
NB for now the fill of objects is performed using glBegin(GL_POLYGON) and that is limited to convex shapes. With concavities you get unpredictable results (e.g. add a fill color to the arrow stim below). To create concavities, you can combine multiple shapes, or stick to just outlines. (If anyone wants to rewrite ShapeStim to use glu tesselators that would be great!)
| Parameters : |
lineColor :
fillColor :
|
|---|
Draw the stimulus in its relevant window. You must call this method after every MyWin.flip() if you want the stimulus to appear on that frame and then update the screen again.
Add or remove a stimulus from the list of stimuli that will be automatically drawn on each flip
| Parameters : |
|
|---|
Turn on (or off) autoLogging for this stimulus.
| Parameters : |
|
|---|
For ShapeStim use setLineColor() or setFillColor()
Set the contrast of the stimulus
DEPRECATED since v1.60.05: Please use setColor
Sets the color of the shape fill. See PatchStim.setColor() for further details of how to use this function.
Note that shapes where some vertices point inwards will usually not ‘fill’ correctly.
DEPRECATED since v1.60.05: Please use setFillColor()
DEPRECATED since v1.60.05: Please use setColor
Sets the color of the shape edge. See PatchStim.setColor() for further details of how to use this function.
DEPRECATED since v1.60.05: Please use setLineColor()
Set the stimulus orientation in degrees
Set the stimulus position in the specified (or inherited) units
DEPRECATED since v1.60.05: Please use setColor
Sets the size of the shape. Size is independent of the units of shape and will simply scale the shape’s vertices by the factor given. Use a tuple or list of two values to scale asymmetrically.
Set this stimulus to use shaders if possible.
Set the xy values of the vertices (relative to the centre of the field). Values should be:
- an array/list of Nx2 coordinates.