Scrolling text help please.

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
AJB2K3
Posts: 11
Joined: Wed Mar 06, 2019 5:20 pm

Scrolling text help please.

Post by AJB2K3 » Sat Jun 01, 2019 7:21 am

I'm working on a scrolling text demo on the M5Stack and this is my code
from m5stack import *
from m5ui import *

clear_bg(0x222222)



btnA = M5Button(name="ButtonA", text="ButtonA", visibility=False)
btnB = M5Button(name="ButtonB", text="ButtonB", visibility=False)
btnC = M5Button(name="ButtonC", text="ButtonC", visibility=False)
label1 = M5TextBox(299, 120, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)

from numbers import Number

position = None



label1.setText('Hello everyone who uses an M5Stack or M5Stick.')
label1.setPosition(300, 121)
position = 300
while True:
label1.setPosition(x=position)
position = (position if isinstance(position, Number) else 0) + -1
if position == 0:
position = 300
wait(0.001)
however, the text autoscrolls to the next line when it goes off screen.

https://www.youtube.com/embed/YJlw2PE75IU

What I would like is for the "offscreen" text to be hidden instead of appearing on the next line.

Q1, is this possible?
Q2, if yes, how?
Q3, Please can you tell me what documents I need to be reading and research to understand this please?

Post Reply