tips:ticertext
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tips:ticertext [2015/05/27 05:08] – jt3 | tips:ticertext [2015/05/27 05:29] (current) – removed jt3 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Scrolling (Ticker) text without masks ====== | ||
- | WatchMaker doesn' | ||
- | |||
- | ===== Examples ===== | ||
- | ==== On_millisecond method ==== | ||
- | === Main Script === | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | pause = 0 | ||
- | while pause <= var_slowdown do | ||
- | | ||
- | pause = pause + 1 | ||
- | end | ||
- | if endpos == string.len(text_work) then | ||
- | | ||
- | end | ||
- | end | ||
- | |||
- | === Text Field of Object(s) === | ||
- | | ||
- | |||
- | ==== Standard Function method ==== | ||
- | === Main Script === | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | wm_schedule {action=' | ||
- | end | ||
- | |||
- | | ||
- | if var_toggle> | ||
- | var_toggle =0 | ||
- | else | ||
- | | ||
- | end | ||
- | end | ||
- | |||
- | === Text Field of Object(s) === | ||
- | tweens.scroll> | ||
- | |||
- | ===== Explanation ===== | ||
- | Okay, notice that we've listed two methods. | ||
- | |||
- | So... back to the two methods. | ||
- | |||
- | 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), | ||
- | |||
- | 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 " | ||
- | |||
- | The Text field, in this case, is very simple, because we did all of the processing in the main script. | ||
- | |||
- | The second method is a lot more battery and processor friendly, and the scroll speed is measured in seconds, making it consistent across devides, 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 " | ||
- | |||
- | 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. | ||
- | |||
- | You might notice that the string length is 15, but we tell it to scroll 16 characters. | ||
- | |||
- | Let's be honest. | ||
- | |||
- | I offered this as a coding challenge, and originally, I simply had fixed text, and scrolled the X coordinates. | ||
- | |||
- | Amazing, no? | ||
tips/ticertext.1432703308.txt.gz · Last modified: 2015/05/27 05:08 by jt3