![]() ![]() glGenLists ( 1 ) # pygame text needs a surface to render to: if not self. anchorVert = anchorVert # generate the texture and list holders self. Use alignText " "and anchorHoriz attributes instead" ) # for compatibility, alignText was historically 'left' alignText, anchorHoriz = alignHoriz, alignHoriz # alignment and anchors self. warning ( "TextStim.alignHoriz is deprecated. Use the " "anchorVert attribute instead" ) # for compatibility, alignText was historically 'left' anchorVert = alignHoriz if alignHoriz : self. warning ( "TextStim.alignVert is deprecated. pos = pos # deprecated attributes if alignVert : self. ![]() _dict_ = ArabicReshaper ( configuration = arabic_config ) self. gl import psychopy # so we can get the _path_ from psychopy import logging # tools must only be imported *after* event or MovieStim breaks on win32 # (JWP has no idea why!) from import cm2pix, deg2pix, convertToPix from import attributeSetter, setAttribute from import ( BaseVisualStim, ForeColorMixin, ContainerMixin, WindowMixin ) from lors import Color # for displaying right-to-left (possibly bidirectional) text correctly: from bidi import algorithm as bidi_algorithm # sufficient for Hebrew # extra step needed to reshape Arabic/Farsi characters depending on # their neighbours: try : from arabic_reshaper import ArabicReshaper haveArabic = True except ImportError : haveArabic = False import numpy try : import pygame havePygame = True except Exception : havePygame = False defaultLetterHeight = # shift by 1 to be compatible with the bidi algorithm self. options = False import ctypes GL = pyglet. #Psychopy alignhoriz drivers## Shaders will work but require OpenGL2.0 drivers AND PyOpenGå…ƒ.0+ import pyglet pyglet. import os import glob import warnings # Ensure setting pyglet.options to False is done prior to any # other calls to pyglet or pyglet submodules, otherwise it may not get picked # up by the pyglet GL engine and have no effect. #Psychopy alignhoriz license## Distributed under the terms of the GNU General Public License (GPL). #!/usr/bin/env python # -*- coding: utf-8 -*- '''Class of text stimuli to be displayed in a :class:`~` ''' # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd. _itemsFile = None _checkSynonyms ( items, fieldNames ) _checkRequiredFields ( fieldNames ) # Add default values if entries missing _addDefaultItems ( items ) # Convert options to list of strings for idx, item in enumerate ( items ): if item : item = listFromString ( item ) if 'tickLabels' in item and item : item = listFromString ( item ) if 'options' in item and item : item = listFromString ( item ) # Check types, item ) for item in items ] # Check N options > 1 # Randomise items if requested if self. union ( item ) fieldNames = list ( fieldNames ) # convert to list at the end self. _itemsFile = Path ( items ) items, fieldNames = importConditions ( items, returnFieldNames = True ) else : # we already have a list so lets find the fieldnames fieldNames = set () for item in items : fieldNames = fieldNames. info ( "Importing items." ) if not isinstance ( items, list ): # items is a conditions file self. colors import Color _REQUIRED = - 12349872349873 # an unlikely int # a dict of known fields with their default vals _knownFields = ". rect import Rect from import importConditions, listFromString from import ( BaseVisualStim, ContainerMixin, ColorMixin ) from psychopy import logging, layout from random import shuffle from pathlib import Path _author_ = 'Jon Peirce, David Bridges, Anthony Haffey' from. #!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |