It appears that neither pygame nor pyglet support underlining so I
believe I have to draw that myself with a 2 vertex shapeStim. To do
this I need to know the width of the word on the screen. In pyglet,
the TextStim width property gives only the wrapping width for the
rectangle in which the TextStim is displayed. If I switch to pygame, I
get the width value I need to use to do the underline drawing, but
pygame does not seem to support multiline text stimuli, so it looks
like I will need to draw the lines of the multiline stimulus
individually.
Am I missing something, or does anyone have any better ideas? Also,
are there disadvantages to using pygame instead of pyglet?
Thanks
Jon Roberts
Computer Lab for Instruction in Psychological Research
Department of Psychology and Neuroscience
University of Colorado at Boulder
This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To post to this group, send email to psychop...@googlegroups.com.
To unsubscribe from this group, send email to psychopy-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/psychopy-users?hl=en.
That works for my current task...
Is pyglet preferable to pygame in general - better performance, etc.?
Using pyglet, I didn't see a way to get the width of the textStim itself, just the width or the word-wrapping rectangle...
thanks...-Jon Roberts
On Mar 1, 2010, at 3:47 AM, Jon Peirce wrote:
actually it would also be a trivial addition to implement underlining for text stimuli in either backend, but this would be underlining the entire stimulus, not just a single word or something.
Jon
I am new to PsychoPy, and currently trying to get a rather simple
Simon experiment to running (actually, I am a little sad that there is
no demo implementation of a simple experiment with different trial
types, blocks, collecting responses and stuff, so if somebody got a
simple thing like this I would really like to take a look at and would
share what i got when it is ready).
As I finally got the trial-handling part, I am trying to implement the
presentation of the stimuli. Following the advise below I started
playing around with a pygame window. However, using either PatchStim
or ShapeStim does not work as expected. Especially, the sizes of the
objects are in no relation to the expected sizes. I just see a tiny
little spot in the center of th screen instead of a spot with 1cm
diameter. However, when changing the winType to 'pyglet' everything
looks fine (i.e., I measured it at my monitor and the sizes match).
It would be great if anyone could help me to dissolve this dissonance,
otherwise I just ignore the below menionted advise to use pygame.
Below you find the minimal code I used.
Greetings,
Henrik
PS: I adjusted the values in the monitor center dialogue to the actual ones.
from psychopy import *
myWin = visual.Window((800,800),monitor='testMonitor', units ='cm',
rgb=-1.0, winType='pygame')
bar = visual.ShapeStim(myWin,
lineRGB=[1,1,1],
lineWidth=2.0,
fillRGB=[1,1,1],
vertices=[[-0.2,0.5],[0.2,0.5],
[0.2,-0.5], [-0.2,-0.5]],
closeShape=True,
pos=[3,0])
fixSpot = visual.PatchStim(myWin,tex="none", units='cm',
mask="circle", size=[1,1],rgb=1)
bar.draw()
fixSpot.draw()
myWin.flip()
core.wait(20)
2010/3/3 Jon Peirce <jonatha...@nottingham.ac.uk>: