|
Post by bipeha on Aug 5, 2021 10:45:57 GMT
Hi!
Is it possible to set an image/bitmap as background?
I've tried to do so following the instructions on the FAQs, but keep getting this error message:
ERROR: unknown_statement in line: 31 >>> show bitmap backgroundtest Problem: Unknown statement.
The section of the code looks like this:
block test show bitmap backgroundtest tasklist flanker 50 end
Thanks!
|
|
|
Post by matia on Aug 7, 2021 9:39:42 GMT
I don't think you can use this command in the block. Instead, you should set background in the task. It will be background because it will be the first bitmap that will be shown and you won't remove it until the trial is over, maybe you don't have to remove it at all.
options resolution 1200 800 fullscreen
task spiderman show rectangle 0 0 1200 800 255 100 100 show rectangle 0 0 600 400 100 255 100 delay 500 clear -1 show rectangle 0 0 200 200 100 100 255 delay 1000 clear -1
block venom tasklist spiderman 10 end As you see, there is a red-ish rectangle (I didn't upload the background bitmap, so I just made a rectangle) that is always present - as a background. Instead of this, you can ofcourse show bitmap background and you're fine (make sure it is the same size as your experiment screen).
Best, Matia
|
|
|
Post by bipeha on Aug 9, 2021 12:20:48 GMT
Great, thanks, Matia!!
Dumb question (sorry, I'm a total newby here): how do I determinde the size of my experiment screen? When I try to implement your solution, I can compile the experiment, but when I run it, the screen remains black...
Thanks a lot, again!
Best, Birgit
|
|
|
Post by bipeha on Aug 9, 2021 13:04:11 GMT
Correction: when I implement you suggestion using the code you gave as example, it works, but when I try to do it with my code (which involves showing text) it does not. I suppose it has something to do with the background used for the text? Do you know whether there's a way to have a transparent background for the text?
|
|
|
Post by matia on Aug 9, 2021 14:43:20 GMT
Great, thanks, Matia!! Dumb question (sorry, I'm a total newby here): how do I determinde the size of my experiment screen? When I try to implement your solution, I can compile the experiment, but when I run it, the screen remains black... Thanks a lot, again! Best, Birgit There is no stupid question
I always like to set the resolution under options. In my example, I've set it to 1200 (width) x 800 (height). In that way it is easy for me to design bitmaps (to fit the screen). If you do not define anything, Psytoolkit uses default resolution of 800 x 600 (but I am not 100% certain, maybe it is 1080 x 720
options resolution 1024 768 fullscreen
bitmaps background https://cdn.wallpapersafari.com/68/45/sUQe4q.jpg
task wantit keys b a n e show bitmap background show rectangle 0 0 600 400 100 255 100 delay 500 clear -1 show text "Who dis?" 0 0 #delay 1000 readkey 1 10000
I have tried putting text directly on the background - works (the text is white). Maybe your background is black and text is black - then it is not visible. However, I suspect that there is a problem with text and/or image used as background that causes the screen to go black... Copy-paste your code here if you want a more detailed feedback.
One way around is to draw a rectangle on top of the background on which the text will be displayed. You will probably have to play around a bit to adjust the text and rectangle width...
Good luck, Matia
|
|
|
Post by bipeha on Aug 11, 2021 9:36:29 GMT
Hi Matia,
thank you so much for your help! I've used your example and now it shows the image in the background, but I'm still unable to get the text to show.
This is the code of the experiment:
options resolution 1024 768 fullscreen
bitmaps pop
table flankers "XXXXX" 1 1 "XXCXX" 1 1 "XXVXX" 0 2 "XXBXX" 0 2 "CCXCC" 1 1 "CCCCC" 1 1 "CCVCC" 0 2 "CCBCC" 0 2 "VVXVV" 0 1 "VVCVV" 0 1 "VVVVV" 1 2 "VVBVV" 1 2 "BBXBB" 0 1 "BBCBB" 0 1 "BBVBB" 1 2 "BBBBB" 1 2
task flanker show bitmap pop table flankers keys a l font Large show text @1 0 0 readkey @3 2000
block test tasklist flanker 10 end
Thanks again!
Birgit
|
|
|
Post by matia on Aug 11, 2021 14:14:46 GMT
When you remove the line font Large, everything works just fine.
But, if you want to have a custom font (larger than usual), then you must first define it in the font chunk:
options fullscreen resolution 1024 768
fonts Large arial 30
task MyTask ... This should solve the problem.
Good luck, Matia
|
|
|
Post by bipeha on Aug 12, 2021 12:12:44 GMT
Awesome. It works perfectly.
THANK YOU!!!
|
|