expyriment.io.Screen

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

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.intialize(exp) will automatically create such a screen instance and will additionally reference it in exp.screen for easy access.

Methods

__init__(colour, open_gl, window_mode, window_size)

Create and set up a screen output.

Parameters :

colour : (int, int, int)

colour of the screen

open_gl : bool

if OpenGL should be used

window_mode : bool

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

Notes

CAUTION: We discourage from creating a screen instance manually!

center_x

Getter for X-coordinate of the screen center.

center_y

Getter for the Y-coordinate of the screen center.

clear()

Clear the screen.

This will reset the default experimental background colour.

colour

Getter for colour.

logging

Getter for logging.

open_gl

Getter for open_gl.

save(filename)

Save the content of the screen as a picture.

Parameters :

filename : str

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 :

onoff : bool

set logging on (True) or off (False)

Notes

See also design.experiment.set_log_level fur further information about event logging.

size

Getter for the size of the screen.

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 :

stimuli : list

stimulus or a list of stimuli to update

Notes

This does only work for non OpenGL screens.

window_mode

Getter for window_mode.

window_size

Getter for window_size.

Previous topic

expyriment.io.ParallelPort

Next topic

expyriment.io.SerialPort

This Page