# Unit 3: animation

**URL:** <https://forum.code.org/t/unit-3-animation/11603>\
**Category:** CS Discoveries\
**Created:** [November 1, 2017, 12:15pm UTC](https://forum.code.org/t/unit-3-animation/11603 "2017-11-01T12:15:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [November 1, 2017, 12:34pm UTC](https://forum.code.org/t/unit-3-animation/11603/2 "2017-11-01T12:34:37Z")

</div>

Create a variable for the x position of the text such as:

var textStart = -200 (off the screen)

Then, when you place the text, place it inside the draw loop using the variable you created as the x position and then increment the variable… the code below would cause it to scroll left to right across the screen.

textSize(20);  
text(“Once there was a fisherman …”, textStart, 375);  
textStart=textStart+3;

---

_[View the full topic](https://forum.code.org/t/unit-3-animation/11603)._
