Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

setting image location in sketchpad OSWeb

Hi,


I am trying to set the image location in sketch pad according to the width of the screen. In the regular version of OpenSesame I did this by setting the x value in the sketch pad according to vars.width , though this isn't working in the OSWeb version. Is this not working since in OSWeb sketchpad named elements are not supported? Is there any workaround this?


Thank you,

Galit

Comments

  • Hi @Galit,

    Named sketchpad elements indeed are not supported yet in osweb. It is weird that using vars.width doesn't work. This should contain the dimensions of the osweb Canvas and you should be able to use it to position elements on the display.

    Buy Me A Coffee

  • Thanks for the reply. Yes, it is weird that it doesn't work in OSWeb.

    Here is the script line I am using in the sketchpad element:

    draw image center=1 file="hammer.png" scale=1.5 show_if=always x="-[vars.width - 50]" y=0 z_index=0

    Is there something wrong here?

  • To clarify, when using the vars.width, the program doesn't crash or get stock, but the image isn't shown on the screen. This is true when setting X to different values [vars.width - X].

  • edited October 2020

    Without having tried it, I think the problem is not in using vars.width itself, but in the expression `[vars.width-50]`. First of all, the brackets should replace the vars part. So, [vars.width] is a bit of double. Then, I would think the arithmetics have to be done outside the brackets. So if anything, I would think that the statement should be "-[width]-50" . However, that doesn't seem to work. What I did now, that seemed to work is adding an inline_javascript to the trial_sequence, before the sketchpad (in its prepare phase) and create a new variable vars.new_x = vars.width-50. This variable can then be used in the field as is, so e.g. [new_x].

    Does that help?

    Eduard

    Buy Me A Coffee

  • Thanks for your reply.

    It seems to work, though for some reason, it looks like the entire screen is not fully used. That is when I define a new variable, new_x, I need to define it very far from the edge of the screen (i.e. vars.width-550) in order to see the visual image, other wise it is cut, or not visible at all. Is there something in the settings I need to change for the experiment to use the entire screen?


    Thank you,

    Galit

  • hi Galit,

    The origin of the coordinate system (0,0) is the middle of the screen. So if your screen is 1000 px wide, the corresponding left edge would have an x coordinate of -500 and the right edge +500. That's why you have to subtract such a large number (at least half of the width), to see something appear on the screen.

    Hope this helps,

    Eduard

    Buy Me A Coffee

  • Hi Eduard,


    According to what you write, I am supposed to see the image in the entire screen, but in principle, I can't see the image in the entire screen. Attached are two screen shots showing, one showing the entire visual image (width-550), and one in which the visual image cut off (width - 500), though as you can see the screen is bigger.


    Thank you,

    Galit



  • Adding, that in the regular version of OpenSesame, not OSweb, the experiment runs in full screen, and the visual image is shown on the side of the screen (width-100).


    Thank you,

    Galit

  • Hi Galit, your experiment has specific dimension (you specify that in the general properties tab). If you run your experiment full screen and that size does not match the screen dimension on which you present it, the rest of the screen is filled with black. Importantly that part is not actually useable by Opensesame. Opensesame can only draw on the area that you specify to be width and height. That's why you get that cut off stimulus. If you increase the stimulus dimension that image should appear entirely.

    hope this clears things up.

    Eduard

    Btw. what I am saying here only applies if you have checked the `uniform coordinates` field on the general properties tab. If you have unchecked it, that (0,0) is not in the center of the screen, but in the top left corner, and the center would indeed be marked with (0.5*width,0.5*height)

    Buy Me A Coffee

  • Thank you

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games