Hello,
How can I update the current text in the text()
, now every time it will make a new text()
element.
Code:
x = 0
def setup():
size(500, 500)
def draw():
global x
text(str(x), 10, 10)
x += 1
Hello,
How can I update the current text in the text()
, now every time it will make a new text()
element.
Code:
x = 0
def setup():
size(500, 500)
def draw():
global x
text(str(x), 10, 10)
x += 1
Hi @cornedb2!
I’m not sure I understad you correctly, but I think you might be missing the frame “clean up”, try using background()
like this:
x = 0
def setup():
size(500, 500)
def draw():
global x
background(200) # ops! GoToLoop saw I've misspelled it as blackground
text(str(x), 10, 10)
x += 1
Another idea is just to draw a small no-stroke rectangle, with the same color as the background, where the new text will be placed, so as to “clean” the pixels for it.
Function text() also accepts a number as its 1st parameter:
So there’s no need to convert it to a string: text(x, 10, 10)
A small mistype there: background(200)