Source

PyCessing / pycessing / data / examples / screen-text.cess

# it's pretty simple to draw text on the screen
myText = ScreenText()

def setup():
    pycessing.noLoop = True
    pycessing.size(600, 400)
     
def draw():
    # you can print a semi-alphabetical list of all fonts available
    myText.listFonts()
    
    myText.setText("hello pycessors")
    myText.draw(20, 320)
    
    #draw it twice a little offset for a cheesy 
    # drop-shadow effect
    myText.setColor(128, 0, 255)
    myText.draw(18, 318)
    
    #put a nice sqare in there
    setFillColor(127, 0, 127, 90)
    rect(20, 20, 200, 200)
    
    # now change the font face and the size
    myText.setFont("Georgia", 40)
    
    #make it red!
    myText.setColor(200, 10, 10)
        
    #now rotate it a little bit
    myText.rotate(30)
    myText.setText("Enjoy Typography!")
    myText.draw(20, 90, 200)
    
    #the object keeps its settings so you can reuse it
    myText.setText("Practice is Perfect")
    myText.draw(230, 180, 200)