def METHOD_NAME(self, buff):
    # do we need units code?
    if self.params['units'].val == 'from exp settings':
        unitsStr = ""
    else:
        unitsStr = "units=%(units)s, " % self.params
    # do writing of init
    # replaces variable params with sensible defaults
    inits = getInitVals(self.params, 'PsychoPy')
    if self.params['wrapWidth'].val in ['', 'None', 'none']:
        inits['wrapWidth'] = 'None'
    code = ("%(name)s = visual.TextStim(win=win, "
            "name='%(name)s',\n"
            "    text=%(text)s,\n"
            "    font=%(font)s,\n"
            "    " + unitsStr +
            "pos=%(pos)s, height=%(letterHeight)s, "
            "wrapWidth=%(wrapWidth)s, ori=%(ori)s, \n"
            "    color=%(color)s, colorSpace=%(colorSpace)s, "
            "opacity=%(opacity)s, \n"
            "    languageStyle=%(languageStyle)s,")
    buff.writeIndentedLines(code % inits)
    flip = self.params['flip'].val.strip()
    if flip == 'horiz':
        flipStr = 'flipHoriz=True, '
    elif flip == 'vert':
        flipStr = 'flipVert=True, '
    else:
        flipStr = ''
    depth = -self.getPosInRoutine()
    buff.writeIndented('    ' + flipStr + 'depth=%.1f);\n' % depth)