| Reference | Downloads | Github

Text Flicker and Possible Solution

Description of the problem: In my experiment, I use my data file to update various text components. I realised that there is a flicker in the text. It shows default_text for one frame and then updates it in the next frame. Here is an example of the javascript code generated.

if text_header_1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
                # keep track of start time/frame for later
                text_header_1.frameNStart = frameN  # exact frame index
                text_header_1.tStart = t  # local t and not account for scr refresh
                text_header_1.tStartRefresh = tThisFlipGlobal  # on global time
                win.timeOnFlip(text_header_1, 'tStartRefresh')  # time at next scr refresh
            if text_header_1.status == STARTED:  # only update if drawing
                text_header_1.setText(thisTrial_dict['Name_1'], log=False)

This might be because it first sets auto draw true and then sets text in the next line. Ill try fixing this by modifying the .js file but it might be better to have it setText earlier in the default code that is generated in the future