LIBtft144 icon indicating copy to clipboard operation
LIBtft144 copied to clipboard

put_string draws unnecessary characters?

Open piotrkochan opened this issue 6 years ago • 0 comments

I've written some code which simulates bouncing text from the wall to wall:

txt = "TEST"
width=len(txt) * 8
height=12

posx=posy=0
xmod=ymod=1

while True:
    posx += xmod
    posy += ymod
    TFT.put_string(txt, posx, posy, TFT.WHITE, TFT.BLACK, 5)

    if posx + width == 127:
        xmod = -1
    if posy + height == 127:
        ymod = -1
    if posx == 0:
        xmod = 1
    if posy == 0:
        ymod = 1
    sleep(0.005)

The result is as on the video: https://youtu.be/is2KnqieLdQ

piotrkochan avatar Oct 07 '19 18:10 piotrkochan