tips:tickertext
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tips:tickertext [2015/05/27 05:28] – jt3 | tips:tickertext [2015/05/27 13:55] (current) – jt3 | ||
---|---|---|---|
Line 58: | Line 58: | ||
The first method is the "on millisecond" | The first method is the "on millisecond" | ||
- | We start by defining some constants, such as the number of characters that will be shown at once (window_length), | + | We start by defining some constants, such as the number of characters that will be shown at once (window_length), |
Once we actually enter the function, we essentially move the visible part of the string along, limiting the visible portion to the window size. So, if we've determined the window size to be 15 characters, we'll show the 1st to 15th character, then the 2nd to 16th, 3rd to 17th, 4th to 18th, etc. If we run out of characters we simply use the " | Once we actually enter the function, we essentially move the visible part of the string along, limiting the visible portion to the window size. So, if we've determined the window size to be 15 characters, we'll show the 1st to 15th character, then the 2nd to 16th, 3rd to 17th, 4th to 18th, etc. If we run out of characters we simply use the " | ||
Line 66: | Line 66: | ||
The second method is a lot more battery and processor friendly, and the scroll speed is measured in seconds, making it consistent across devices, but the major disadvantage is that the text must completely scroll out of sight before it can start up again, because there is a slight delay as you recall the function (which restarts the scrolling text... as each function call only scrolls the text one time). | The second method is a lot more battery and processor friendly, and the scroll speed is measured in seconds, making it consistent across devices, but the major disadvantage is that the text must completely scroll out of sight before it can start up again, because there is a slight delay as you recall the function (which restarts the scrolling text... as each function call only scrolls the text one time). | ||
- | Here, we start by defining some initial values for certain variables (mainly to prevent " | + | Here, we again start by defining some initial values for certain variables (mainly to prevent " |
The function, in this case is simply a " | The function, in this case is simply a " | ||
- | The text object is a bit more complicated here, since we did very little processing in the main script. | + | The text object is a bit more complicated here, since we did very little processing in the main script. |
You might notice that the string length is 15, but we tell it to scroll 16 characters in the tween statement. | You might notice that the string length is 15, but we tell it to scroll 16 characters in the tween statement. |
tips/tickertext.txt · Last modified: 2015/05/27 13:55 by jt3