Howdy, Stranger!

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

Supported by

mousetrap_response coordinates don't match

edited January 2017 in OpenSesame

Question 1:
I have made a mousetrap_response thing with buttons with the coordinates that opensesame shows when you look at the sketchpad grid. The buttons kind of work, but the coordinates don't seem to exactly match. The buttons only work if you click on a certain spot, rather than anywhere in the button.

For example, I have coordinates:
x=-288 y=192 w=-224 h=256
This represents a square button with the coordinates (-288, 192), (-288, 256), (-224, 192), (-224, 256), right?
But it isn't working like that. Do you know why? How can I fix it?

Question 2:
Can you make over 4 buttons using mousetrap_response?
I know that in the "control" view of it, there are only 4 buttons, however if you add buttons in the "script", can they work?
Mine don't, but I'm having issues with the coordinates anyway..

This is what I have in the script:

__warning_message__
draw textline text="Please start moving" x=0 y=0 sketchpad=example
__end__
set update_feedback no
set timeout infinite
set start_coordinates "0;280"
set skip_item no
set save_trajectories yes
set reset_mouse no
set number_of_buttons 5
set mouse_buttons_allowed "left_button;right_button"
set max_initiation_time 1000
set logging_resolution 10
set description "Tracks mouse movements"
set correct_button lila
set click_required yes
set check_initiation_time no
set button5 "x=288 y=-224 w=352 h=-160 name=grün"
set button4 "x=-352 y=-224 w=-288 h=-160 name=gelb"
set button3 "x=224 y=192 w=288 h=256 name=hellblau"
set button2 "x=-32 y=192 w=32 h=256 name=lila"
set button1 "x=-288 y=192 w=-224 h=256 name=rot"
set boundaries "upper=no lower=no left=no right=no"

I just edited the script to make it have 5 buttons instead of 4.

Question 3
If you cannot make more than 4 buttons using mousetrap_response, is there any way to change the format of mousetrap_form buttons?
I want my buttons to be an image of a colour. I've successfully made 6 buttons using mousetrap_form, but I can't figure out how to insert an image onto the button. Is there any way to do that?

Appreciate any feedback on any of these questions.
Thank you!

Comments

  • Thanks, @sebastiaan, just was looking at it :smile:

    Re Question 1:

    The coordinates
    x=-288 y=192 w=-224 h=256
    represent a button with the coordinates (-288, 192), (-288, 192+256), (-288-224, 192), (-288-224,192+256), i.e., (-288, 192), (-288, 448), (-512, 192), (-512,448), as the width (w) and height (h) get added to x and y respectively.

    The idea is that you can draw a rect element on a sketchpad that represents the button borders and extract the relevant coordinates from its OpenSesame script.

  • Re Question 2:

    If you would like to have more than 4 buttons and want to use a sketchpad / canvas for presenting them, you cannot add them to a mousetrap_response item by modifying its OpenSesame script. Instead, you would use the MT_response class in Python. You can find an example experiment here. It is called "mousetrap_response_python.osexp".

  • Re Question 3:

    If you would like to use images as buttons on a form, you can use an image_button widget.

    You can add this using OpenSesame script to a mousetrap_form item. However, if you are not interested in the mouse-tracking data, you could also use just the standard form_base item.

    Alternatively, if your images are really just colored rectangles, you can also create them using filled rect elements on a sketchpad, e.g., like this:

    draw rect color=green fill=1 h=128 penwidth=1 show_if=always w=160 x=-352 y=-256 z_index=0

    You can also vary the color using an experimental variable:

    draw rect color=[button1_color] fill=1 h=128 penwidth=1 show_if=always w=160 x=-352 y=-256 z_index=0

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