Scroll text

https://microstudio.io/jkeks/demo/9HRN3M7K/

example of scroll text. thruely right coordianates calculations.

init = function()
  text    = "Hello 😈 world"
  text_w  = screen.textWidth(text,24)
  start_x = screen.width/2+text_w/2
  text_x  = start_x
  text_y  = 0
end

update = function()
  text_x -= 2.6
  if (text_x < -start_x) then text_x = start_x end
end

draw = function()
  screen.clear()
  screen.drawText( text,text_x,text_y,24,"red")
end