|
| | __init__ (self, dispsize=settings.DISPSIZE, fgc=settings.FGC, bgc=settings.BGC, screennr=settings.SCREENNR, mousevisible=settings.MOUSEVISIBLE, screen=None, **args) |
| |
| | create (self, screen=None) |
| |
| | clear (self, colour=None) |
| |
| | copy (self, screen) |
| |
| | draw_circle (self, colour=None, pos=None, r=50, pw=1, fill=False) |
| |
| | draw_ellipse (self, colour=None, x=None, y=None, w=50, h=50, pw=1, fill=False) |
| |
| | draw_rect (self, colour=None, x=None, y=None, w=50, h=50, pw=1, fill=False) |
| |
| | draw_line (self, colour=None, spos=None, epos=None, pw=1) |
| |
| | draw_polygon (self, pointlist, colour=None, pw=1, fill=True) |
| |
| | draw_fixation (self, fixtype='cross', colour=None, pos=None, pw=1, diameter=12) |
| |
| | draw_text (self, text='text', colour=None, pos=None, center=True, font='mono', fontsize=12, antialias=True) |
| |
| | draw_image (self, image, pos=None, scale=None) |
| |
| | set_background_colour (self, colour=None) |
| |
| | __init__ (self) |
| |
A class for PsychoPy Screen objects, for visual stimuli (to be displayed via a Display object)
| pygaze._screen.psychopyscreen.PsychoPyScreen.clear |
( |
| self, |
|
|
| colour = None ) |
Clears the screen and fills it with a colour
arguments
None
keyword arguments
colour -- the colour to fill the screen with (a colour name
(e.g. 'red') or a RGB(A) tuple (e.g. (255,0,0) or
(255,0,0,255))) or None for the default background
colour, self.bgc (default = None)
returns
Nothing -- clears self.screen property
Reimplemented from pygaze._screen.basescreen.BaseScreen.
| pygaze._screen.psychopyscreen.PsychoPyScreen.draw_circle |
( |
| self, |
|
|
| colour = None, |
|
|
| pos = None, |
|
|
| r = 50, |
|
|
| pw = 1, |
|
|
| fill = False ) |
Draws a circle on the screen
arguments
None
keyword arguments
colour -- colour for the circle (a colour name (e.g. 'red') or
a RGB(A) tuple (e.g. (255,0,0) or (255,0,0,255))) or
None for the default foreground colour, self.fgc
(default = None)
pos -- circle center, an (x,y) position tuple or None for a
central position (default = None)
r -- circle radius (default = 50)
pw -- penwidth: circle line thickness (default = 1)
fill -- Boolean indicating whether circle should be filled or
not (default = False)
returns
Nothing -- draws a circle on (PyGame) or adds a Circle stimulus
to (PsychoPy) the self.screen property
Reimplemented from pygaze._screen.basescreen.BaseScreen.
| pygaze._screen.psychopyscreen.PsychoPyScreen.draw_ellipse |
( |
| self, |
|
|
| colour = None, |
|
|
| x = None, |
|
|
| y = None, |
|
|
| w = 50, |
|
|
| h = 50, |
|
|
| pw = 1, |
|
|
| fill = False ) |
Draws an ellipse on the screen
arguments
None
keyword arguments
colour -- colour for the circle (a colour name (e.g. 'red') or
a RGB(A) tuple (e.g. (255,0,0) or (255,0,0,255))) or
None for the default foreground colour, self.fgc
(default = None)
x -- x coordinate of the rectangle in which the ellipse is
drawn or None for a horizontal centrally drawn
ellipse (default = None)
y -- y coordinate of the rectangle in which the ellipse is
drawn or None for a vertical centrally drawn
ellipse (default = None)
w -- width of the rectangle in which the ellipse is drawn
(default = 50)
h -- height of the rectangle in which the ellipse is drawn
(default = 50)
pw -- penwidth: circle line thickness (default = 1)
fill -- Boolean indicating whether ellipse should be filled
or not (default = False)
returns
Nothing -- draws an ellipse on (PyGame) or adds a GratinsStim
stimulus to (PsychoPy) the self.screen property
Reimplemented from pygaze._screen.basescreen.BaseScreen.
| pygaze._screen.psychopyscreen.PsychoPyScreen.draw_fixation |
( |
| self, |
|
|
| fixtype = 'cross', |
|
|
| colour = None, |
|
|
| pos = None, |
|
|
| pw = 1, |
|
|
| diameter = 12 ) |
Draws a fixation (cross, x or dot) on the screen
arguments
None
keyword arguments
fixtype -- type of fixation mark, should be either of the
following strings:
'cross' -- a '+'
'x' -- a 'x'
'dot' -- a filled circle
(default = 'cross')
colour -- colour for the circle (a colour name (e.g. 'red') or
a RGB(A) tuple (e.g. (255,0,0) or (255,0,0,255))) or
None for the default foreground colour, self.fgc
(default = None)
pos -- fixation center, an (x,y) position tuple or None for
a central position (default = None)
pw -- penwidth: fixation line thickness (default = 1)
diameter -- diameter of the fixation mark in pixels (default =
12)
returns
Nothing -- draws on (PyGame) or adds stimuli to (PsychoPy) the
self.screen property
Reimplemented from pygaze._screen.basescreen.BaseScreen.
| pygaze._screen.psychopyscreen.PsychoPyScreen.draw_line |
( |
| self, |
|
|
| colour = None, |
|
|
| spos = None, |
|
|
| epos = None, |
|
|
| pw = 1 ) |
Draws a line on the screen
arguments
None
keyword arguments
colour -- colour for the circle (a colour name (e.g. 'red') or
a RGB(A) tuple (e.g. (255,0,0) or (255,0,0,255))) or
None for the default foreground colour, self.fgc
(default = None)
spos -- line start, an (x,y) position tuple or None for a
quarter x and a central y position (default = None)
epos -- line end, an (x,y) position tuple or None for a
three-quarter x and a central y position (default =
None)
pw -- penwidth: line thickness (default = 1)
returns
Nothing -- draws a line on (PyGame) or adds a Line stimulus to
(PsychoPy) the self.screen property
Reimplemented from pygaze._screen.basescreen.BaseScreen.
| pygaze._screen.psychopyscreen.PsychoPyScreen.draw_polygon |
( |
| self, |
|
|
| pointlist, |
|
|
| colour = None, |
|
|
| pw = 1, |
|
|
| fill = True ) |
Draws a polygon on the screen
arguments
pointlist -- a list of (x,y) tuples resembling the cornerpoints
of the polygon
keyword arguments
colour -- colour for the circle (a colour name (e.g. 'red') or
a RGB(A) tuple (e.g. (255,0,0) or (255,0,0,255))) or
None for the default foreground colour, self.fgc
(default = None)
pw -- penwidth: polygon line thickness (default = 1)
fill -- Boolean indicating whether polygon should be filled
or not (default = False)
returns
Nothing -- draws a polygon on (PyGame) or adds a ShapeStim
stimulus to (PsychoPy) the self.screen property
Reimplemented from pygaze._screen.basescreen.BaseScreen.
| pygaze._screen.psychopyscreen.PsychoPyScreen.draw_rect |
( |
| self, |
|
|
| colour = None, |
|
|
| x = None, |
|
|
| y = None, |
|
|
| w = 50, |
|
|
| h = 50, |
|
|
| pw = 1, |
|
|
| fill = False ) |
Draws a rectangle on the screen
arguments
None
keyword arguments
colour -- colour for the circle (a colour name (e.g. 'red') or
a RGB(A) tuple (e.g. (255,0,0) or (255,0,0,255))) or
None for the default foreground colour, self.fgc
(default = None)
x -- x coordinate of the rectangle or None for a
horizontal centrally drawn rectangle (default = None)
y -- y coordinate of the rectangle or None for a
vertical centrally drawn rectangle (default = None)
w -- width of the rectangle (default = 50)
h -- height of the rectangle (default = 50)
pw -- penwidth: ellipse line thickness (default = 1)
fill -- Boolean indicating whether rectangle should be filled
or not (default = False)
returns
Nothing -- draws a rectangle on (PyGame) or adds a GratinsStim
stimulus to (PsychoPy) the self.screen property
Reimplemented from pygaze._screen.basescreen.BaseScreen.
| pygaze._screen.psychopyscreen.PsychoPyScreen.draw_text |
( |
| self, |
|
|
| text = 'text', |
|
|
| colour = None, |
|
|
| pos = None, |
|
|
| center = True, |
|
|
| font = 'mono', |
|
|
| fontsize = 12, |
|
|
| antialias = True ) |
Draws a text on the screen
arguments
None
keyword arguments
text -- string to be displayed (newlines are allowed and will
be recognized) (default = 'text')
colour -- colour for the circle (a colour name (e.g. 'red') or
a RGB(A) tuple (e.g. (255,0,0) or (255,0,0,255))) or
None for the default foreground colour, self.fgc
(default = None)
pos -- text position, an (x,y) position tuple or None for a
central position (default = None)
center -- Boolean indicating is the pos keyword argument should
indicate the text center (True) or the top right
coordinate (False) (default = True)
font -- font name (a string value); should be the name of a
font included in the PyGaze resources/fonts directory
(default = 'mono')
fontsize -- fontsize in pixels (an integer value) (default = 12)
antialias -- Boolean indicating whether text should be antialiased
or not (default = True)
returns
Nothing -- renders and draws a surface with text on (PyGame) or
adds SimpleTextStim to (PsychoPy) the self.screen
property
Reimplemented from pygaze._screen.basescreen.BaseScreen.
| pygaze._screen.psychopyscreen.PsychoPyScreen.set_background_colour |
( |
| self, |
|
|
| colour = None ) |
Set the background colour to colour
arguments
None
keyword arguments
colour -- colour for the circle (a colour name (e.g. 'red') or
a RGB(A) tuple (e.g. (255,0,0) or (255,0,0,255))) or
None for the default foreground colour, self.fgc
(default = None)
returns
Nothing -- sets bgc property to specified colour
Reimplemented from pygaze._screen.basescreen.BaseScreen.