Eyetracker |

Loading...
Searching...
No Matches
Public Member Functions | List of all members
pygaze._screen.basescreen.BaseScreen Class Reference
Inheritance diagram for pygaze._screen.basescreen.BaseScreen:

## Public Member Functions
| __init__ (self)
| create (self)
| clear (self)
| copy (self)
| draw_circle (self)
| draw_ellipse (self)
| draw_rect (self)
| draw_line (self)
| draw_polygon (self)
| draw_fixation (self)
| draw_text (self)
| draw_image (self)
| set_background_colour (self)

## Detailed Description

    A class for PyGame Screen objects, for visual stimuli (to be displayed via a Display object)

## Constructor & Destructor Documentation

## ◆ __init__()

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

## Member Function Documentation

## ◆ clear()

pygaze._screen.basescreen.BaseScreen.clear | ( |  | self | ) |

            Clears the screen and fills it with a colour

            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)

            returns

            None        --  clears self.screen property

Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.

## ◆ copy()

pygaze._screen.basescreen.BaseScreen.copy | ( |  | self | ) |

            Copies a screen to the current screen

            arguments

            screen  --  a screen.Screen instance

            keyword arguments

            None

            returns

            None        --  sets the self.screen property to a copy of
                        screen.screen

Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.

## ◆ create()

pygaze._screen.basescreen.BaseScreen.create | ( |  | self | ) |

            Creates a new Screen instance, filled with either the background
            colour or specified screen (this method is sort of a secondary
            constructor and intended for internal use; calling it will reset
            the Screen)

            arguments

            None

            keyword arguments

            screen  --  a screen.Screen instance, to be displayed on the
                        new Screen or None for the background colour

            returns

            None        --  sets the self.screen property to a PyGame Surface
                        or a list of PsychoPy stimuli, depening on the
                        disptype

Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.

## ◆ draw_circle()

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.

## ◆ draw_ellipse()

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.

## ◆ draw_fixation()

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.

## ◆ draw_image()

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.

## ◆ draw_line()

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.

## ◆ draw_polygon()

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.

## ◆ draw_rect()

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.

## ◆ draw_text()

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.

## ◆ set_background_colour()

pygaze._screen.basescreen.BaseScreen.set_background_colour | ( |  | self | ) |

            Set the background colour

            arguments

            None

            keyword arguments

            colour  --  intended 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)

            returns

            None        --  sets bgc property to specified colour

Reimplemented in pygaze._screen.osscreen.OSScreen, pygaze._screen.psychopyscreen.PsychoPyScreen, and pygaze._screen.pygamescreen.PyGameScreen.

The documentation for this class was generated from the following file:

- C:/Users/lurax/eyetrackingTobii/pygaze/_screen/basescreen.py