Displaying text - how to move or change it?



  • As im diving into M5 programming I am realizing many shortcomings with the text display functions. It appears one only gets to print a string at a location but then one must paint over it to clear it. There is no such thing as keeping a reference to a printed string so one can manipulate it

    Consider for example a console display. one line of text is entered, then next one moves the previous one up. To implement this, one has to painfully track the position of each line string, clear the text are, then redraw everything again.

    I am coming from the world of javascript where one can target a DOM and quickly change it.

    Would this be easier if I moved into micro python or does it suffer the same limitations?

    Is it really this obtuse? Can someone recommend any libraries, books, blogs to get me up to speed and lessen the pain ?



  • At the moment, clearing the old position then printing is the fastest way to do it http://forum.m5stack.com/topic/173/how-to-avoid-text-flicker/3 you can print to sprite if you use the eSPI library and that'll gain you a few ns on the chip but I think the bottleneck is the SPI protocol, that's what Bodner was saying.
    You can wrap the clear and print in a function which will make your code as concise as using an object.