A class for PyGame Screen objects, for visual stimuli (to be displayed via a Display object)
| pygaze._screen.basescreen.BaseScreen.__init__ |
( |
| self | ) |
|
Initializes a Screen instance
arguments
None
keyword arguments
dispsize -- a (width, height) tuple indicating the display
resolution (default = DISPSIZE)
fgc -- foreground colour: a RGB tuple, e.g. (255,0,0)
for red or (0,0,0) for black (default = FGC)
bgc -- background colour: a RGB tuple, e.g. (255,0,0)
for red or (0,0,0) for black (default = BGC)
mousevisible -- Boolean indicating if the mouse should be
visible or not (default = MOUSEVISIBLE)
WARNING: DEPRECATED
screen -- a pygaze.screen.Screen instance that is to be
copied onto the current screen
| pygaze._screen.basescreen.BaseScreen.draw_circle |
( |
| self | ) |
|
Draws a circle on the Screen
arguments
None
keyword arguments
colour -- drawing colour colour: a RGB tuple, e.g. (255,0,0)
for red or (0,0,0) for black; or None for the
default foreground colour, self.fgc (default = None)
pos -- circle center, a (x,y) position tuple or None for a
central position (default = None)
r -- circle radius (default = 50)
pw -- penwidth: line thickness (default = 1)
fill -- Boolean indicating whether stimulus should be
filled or not (default = False)
returns
None -- draws a circle on the Screen
Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.
| pygaze._screen.basescreen.BaseScreen.draw_ellipse |
( |
| self | ) |
|
Draws an ellipse on the Screen
arguments
None
keyword arguments
colour -- drawing colour colour: a RGB tuple, e.g. (255,0,0)
for red or (0,0,0) for black; 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: line thickness (default = 1)
fill -- Boolean indicating whether stimulus should be
filled or not (default = False)
returns
None -- draws an ellipse on the Screen
Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.
| pygaze._screen.basescreen.BaseScreen.draw_fixation |
( |
| self | ) |
|
Draws a fixation target (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 -- drawing colour colour: a RGB tuple, e.g. (255,0,0)
for red or (0,0,0) for black; or None for the
default foreground colour, self.fgc (default = None)
pos -- fixation center, a (x,y) position tuple or None for
a central position (default = None)
pw -- penwidth: line thickness (default = 1)
diameter -- diameter of the fixation mark in pixels (default = 12)
returns
None -- draws a fixation target on the Screen
Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.
| pygaze._screen.basescreen.BaseScreen.draw_image |
( |
| self | ) |
|
Draws an image on the Screen
arguments
image -- a full path to an image file, a PIL Image, or a
pygame Surface (pygame Surface only recognized if
disptype == 'pygame'); NOTE: if image is neither of
these, this function will attempt to treat the
image as a PIL Image, and will raise an Exception
if this fails
keyword arguments
pos -- image center position, an (x,y) position tuple or
None for a central position (default = None)
scale -- scale factor for the image or None for no scaling
(default = None)
returns
None -- loads and draws an image on the Screen
Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.
| pygaze._screen.basescreen.BaseScreen.draw_line |
( |
| self | ) |
|
Draws a line on the Screen
arguments
None
keyword arguments
colour -- drawing colour colour: a RGB tuple, e.g. (255,0,0)
for red or (0,0,0) for black; or None for the
default foreground colour, self.fgc (default = None)
spos -- line start, a (x,y) position tuple or None for a
quarter x and a central y position (default = None)
epos -- line end, a (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
None -- draws a line on the Screen
Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.
| pygaze._screen.basescreen.BaseScreen.draw_polygon |
( |
| self | ) |
|
Draws a polygon on the Screen
arguments
pointlist -- a list of (x,y) tuples resembling the cornerpoints
of the polygon
keyword arguments
colour -- drawing colour colour: a RGB tuple, e.g. (255,0,0)
for red or (0,0,0) for black; or None for the
default foreground colour, self.fgc (default = None)
pw -- penwidth: line thickness (default = 1)
fill -- Boolean indicating whether stimulus should be
filled or not (default = False)
returns
None -- draws a polygon on the Screen
Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.
| pygaze._screen.basescreen.BaseScreen.draw_rect |
( |
| self | ) |
|
Draws a rectangle on the Screen
arguments
None
keyword arguments
colour -- drawing colour colour: a RGB tuple, e.g. (255,0,0)
for red or (0,0,0) for black; 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: line thickness (default = 1)
fill -- Boolean indicating whether stimulus should be
filled or not (default = False)
returns
None -- draws a rectangle on the Screen
Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.
| pygaze._screen.basescreen.BaseScreen.draw_text |
( |
| self | ) |
|
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 -- drawing colour colour: a RGB tuple, e.g. (255,0,0)
for red or (0,0,0) for black; or None for the
default foreground colour, self.fgc (default = None)
pos -- text position, a (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 left
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
None -- renders and draws text on the Screen
Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.