Zerveorus

Texto movil

May 12th, 2017
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.28 KB | None | 0 0
  1. --Script hecho por Miiiclaroo
  2. local text = "Saint & tora"     --texto que aparecerá
  3. local x = 200                   --ubicación en x (de 0 a 800)
  4. local y = 100                   --ubicación en y (de 0 a 400)
  5. local width = 200               --largo del cuadro de texto
  6. local height =30                --alto del cuadro de texto
  7. local letter_size = 20          --tamaño de letra
  8.  
  9. --no modificar nada de aquí en adelante
  10.  
  11. local actual_lenght
  12. local text_lenght
  13. local right = true
  14. local left = false
  15.  
  16. function define_text(string)
  17. text_lenght = string.len(string)
  18. actual_lenght = text_lenght
  19. end
  20.  
  21. function write_right()
  22. ui.addTextArea(1,"<font size='"..letter_size.."' color='#00000'><p align='right'>"..text:sub(1,actual_lenght),nil,x,y,width,height,0,0,true)
  23. actual_lenght = actual_lenght -1
  24. end
  25.  
  26. function write_left()
  27. if actual_lenght < 1 then actual_lenght = 1 end
  28. ui.addTextArea(1,"<font size='"..letter_size.."' color='#00000'><p align='left'>"..text:sub(1,actual_lenght),nil,200,100,width,height,0,0,0,true)
  29. actual_lenght = actual_lenght +1
  30. end
  31.  
  32. function eventLoop()
  33. if actual_lenght > -1 and right then
  34. write_right()
  35. elseif actual_lenght == -1 then
  36. right = false
  37. left = true
  38. end
  39. if left then
  40.     if actual_lenght >= text_lenght then
  41.         left = false
  42.         right = true
  43.     else
  44.         write_left()
  45.     end
  46. end
  47. end
  48.  
  49. define_text(text)
Advertisement
Add Comment
Please, Sign In to add comment