expyriment.io.Screen

class expyriment.io.Screen(colour, open_gl, window_mode, window_size, no_frame)

A class implementing a screen output.

Each experiment and all stimuli need a screen instance to function. They are expecting this screen instance to be referenced in expyriment._active_exp.screen. Calling expyriment.control.initialize(exp) will automatically create such a screen instance and will additionally reference it in exp.screen for easy access.

__init__(colour, open_gl, window_mode, window_size, no_frame)

Create and set up a screen output.

Parameters:
colour(int, int, int)

colour of the screen

open_glint or bool

0/False - No OpenGL (no vsync / no blocking) 1 - OpenGL (vsync / no blocking) 2/True - OpenGL (vsync / blocking) 3 - OpenGL (vsync / alternative blocking)

window_modebool

if screen should be a window

window_size(int, int)

size of the window in window_mode, full screen mode if size of window_mode[0]<=0

no_framebool

set True for windows (in window mode) with no frame; this parameter does not affect fullscreen mode

Notes

CAUTION: We discourage from creating a screen instance manually!

property center_x

Getter for X-coordinate of the screen center.

Notes

Each initialized experiment has its one screen (exp.screen). Please use always the screen of your current experiment.

property center_y

Getter for the Y-coordinate of the screen center.

Notes

Each initialized experiment has its one screen (exp.screen). Please use always the screen of your current experiment.

clear()

Clear the screen.

This will reset the default experimental background colour.

property colour

Getter for colour.

property logging

Getter for logging.

property monitor_resolution

Getter for monitor_resolution.

property no_frame

Getter for no_frame boolean

property open_gl

Getter for open_gl.

save(filename)

Save the content of the screen as a picture.

Parameters:
filenamestr

name of the file to write (possible extensions are BMP, TGA, PNG, or JPEG, with the default being TGA)

set_logging(onoff)

Set logging of this object on or off

Parameters:
onoffbool

set logging on (True) or off (False)

property size

Getter for the size of the screen.

Notes

Each initialized experiment has its one screen (exp.screen). Please use always the screen of your current experiment.

property surface

Getter for surface.

update()

Update the screen.

This will flip the display double buffer.

update_stimuli(stimuli)

Update only some stimuli on the screen.

Parameters:
stimulilist

stimulus or a list of stimuli to update

Notes

This does only work for non OpenGL screens.

property window_mode

Getter for window_mode.

property window_size

Getter for window_size.