[open] User defined characters
Hi,
I was hoping someone could help me with the following problem. I am programming a dot-probe task in which a pair of words is briefly presented on each trial, before a probe then appears in the location of one of the previously displayed words. The position I would like this probe to appear is one of the characters (selected at random) in either one of the previously displayed words. I've been able to implement this approach using probes that are a single character (e.g. e or f), but what I would really like to do is have a probe that is either a single dot (.) or two closely adjacent dots (..). As I found out, using the '.' to show the two-dot probe doesn't work as the two dots appear too far apart. I was digging around and reckon that some of the unicode characters may be more suitable (though I haven't worked out how to use these yet), but what I was really wondering is whether it is possible to generate a user defined character in python, which I can then use as a probe in the task?
It's actually a more general question about whether generating user defined characters is possible. The language my supervisor programs in has this capacity, and he tells me it has provided a lot of flexibility for the types of tasks he has run over the years.
Thanks in advance.
Ben
PS Thanks for putting this package together. I'm a newbie to programming, and I've found Opensesame to be an excellent platform to learn how to get tasks up and running!
Comments
Hi Ben,
Very good question! What you could always do, is generate such a character outside of OpenSesame (e.g. using GIMP), and display the image using a sketchpad.
Obviously, it would be nice to generate any kind of character online too. What kind of functionality would you like to see? Being able to generate a 2D matrix that contains 1s for white, and 0s for black (or any other foreground and background colours)? Would you then specify manually which pixels should form the character? (this, BTW, can already be done using a PyGame surfarray, or a PsychoPy GratingStim) What kind of interface does the other language you speak of have to create these characters? And how does a user define them?
Best,
Edwin
Hi Edwin,
Thanks for your reply. I had thought of generating an image but I wasn't sure how to (or whether it is possible to) present an image in the location previously occupied by one character of a letter string. I've used unicode characters for the moment, which is working fine, but if it were possible to generate user defined characters that would be quiet helpful.
You'll have to excuse me if anything I'm about to write doesn't make sense as I'm not too familiar with 'programming speak', but here it goes...
In the programming language my supervisor uses (BBS Basic), there is a band of ASCII characters available to be user defined (32 – 255). Each user defined character is represented by an 8 x 8 grid. Each row of this grid is expressed as an 8 bit number between 0 – 255. So what the user has to do is enter a number for each of the 8 rows of the grid. I'm not exactly sure how the numbering works, but as I understand it, each unique combination of the 8 pixels, which could potentially be generated for each row, is represented by a specific number. So, for example, if you were to enter an 8 for the first row of the grid, you would get a filled in black pixel in the 2 second column of that row, and all of the others would be left blank... or something like that.
I'm not sure if that makes sense, but I'll take a look at the PyGame surfarray, and the PsychoPy GratingStim, as it sounds like they can do similar to what I'm after.
All best,
Ben