locked
How to "over and over again" animate TEXT RRS feed

  • Question

  • I can't speak english well.

     

    I want to animate Text or IMAGE "over and over again"

     

    --------------------->

    <--------------------

    --------------------->

    <--------------------


    Middle school CS Teacher in KOREA. Like Coding & Programming!
    Monday, November 28, 2011 9:21 AM

Answers

  • There is no direct command to do this, probably the easiest is to create a shape for each letter that you move in a loop.

    Basic example to start with below.  Have a go with this and post again if you have questions or if you want the animation somewhat different, preferably with you code so far.

    GraphicsWindow.Show()
    sampleText = "Hello World"
    nChar = Text.GetLength(sampleText)
    GraphicsWindow.FontSize = 20
    
    'Create a shape for each character
    For i = 1 To nChar
      char = Text.GetSubText(sampleText,i,1)
      txt[i] = Shapes.AddText(char)
    EndFor
    
    While ("True")
      animate()
      shiftChar()
      Program.Delay(1000)
    EndWhile
    
    'Sub to animate text
    Sub animate
      For i = 1 To nChar
        Shapes.Animate(txt[i],100+20*i,100,1000)
      EndFor
      Program.Delay(100)
    EndSub
    
    'Sub to shift the characters
    Sub shiftChar
      tmp = txt[1]
      For i = 1 To nChar-1
        txt[i] = txt[i+1]
      EndFor
      txt[nChar] = tmp
    EndSub
      


    Monday, November 28, 2011 6:49 PM