Change location of items in form using code

Hi,

This question is related to a previous topic that I opened. Since, I am presenting Japanese characters in my form, Im using custom code to present the items (instead of a form component)…

However, I would like to change the y-location of the items (I only succeed to change their x-location)… Specifically, I would like the items to be placed slightly down (closer to the corresponding yes/no options). Or else, its not that clear which item belongs to which yes/no option (please see the image below)… Please also see below the relevant code. I hope someone can help! :slight_smile: :pray:

CODE:

win.allowStencil = True
form = visual.Form(win=win, name=‘form’,
** #items=‘my_form_symp_female.csv’,**
** items=‘my_form_symp_female.xlsx’,**
** textHeight=0.02,**
** randomize=False,**
** size=(1.5, .7),**
** pos=(0, 0),**
** style=(‘dark’,),**
** itemPadding=0.07)**
#words = 3 # may want this to vary with survey type

for i, item in enumerate(form.items):
** if ‘itemCtrl’ not in item:**
** # Skip if there’s no label**
** continue**
** if not isinstance(item[‘itemCtrl’], visual.TextBox2):**
** # Skip if the label isn’t a TextBox**
** continue**
** # Figure out whether there are any Hebrew characters in the label**
** language = “LTR” # Start out with left-to-right**
** # Create an equivalent TextStim object**
** baseY = item[‘itemCtrl’]._baseY # store Form-specific param**
** form.items[i][‘itemCtrl’] = visual.TextStim(win,**
** text=item[‘itemCtrl’].text, **
** font=“Arimo”, # Arimo is a Google Font which can render other characters**
** pos=[**
** item[‘itemCtrl’].pos[0]+item[‘itemCtrl’].size[0]/2, # adjust position to account for anchor**
** item[‘itemCtrl’].pos[1]**
** ], **
** height=item[‘itemCtrl’].letterHeight,**
** languageStyle=language)**
** form.items[i][‘itemCtrl’]._baseY = baseY**