Bug with python mode

You were correct, I fixed it now:

txt = '1';

def setup():
    size(600,600)
    noFill()
    noStroke()

def draw():
    fill('#FF0000') # red quadrant
    rect(width/2,0, width/2,height/2)

    fill('#004477') # blue quadrant
    rect(0,0, width/2,height/2)

    fill('#6633FF') # violet quadrant
    rect(0,height/2, width/2,height/2)

    fill('#FF9900') # orange quadrant
    rect(width/2,height/2, width/2,height/2)
    
    fill(255)
    if mouseX < width/2 and mouseY < height/2:
        #text("BLUE",mouseX,mouseY)
        txt = 'BLUE'
    elif mouseX < width/2 and mouseY > height/2:
        #text("PURPLE",mouseX,mouseY)
        txt = 'PURPLE'
    elif mouseX > width/2 and mouseY < height/2:
        #text("RED",mouseX,mouseY)
        txt = 'RED'
    elif mouseX > width/2 and mouseY > height/2:
        #text("YELLOW",mouseX,mouseY)
        txt = 'YELLOW'
    else:
        txt = 'NONE'
    text(txt,mouseX,mouseY)
1 Like