Onosendai [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=11304 Trying to understand how to sinus scroller text <p>I would like to learn how to reproduce the famous sinus scroller text effect, but i can't make it to work.</p> <p>Can someone explain the idea behind this ? I don't want the code (i want to find it myself), i just want to understand how to approach this.</p> <p>I've created a table with a cell for each letter of my text, now i need to print and move each later to the left in a sinus pattern, but i can't figured out :</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> cls() table={1,2,3,4,5,6} x=127 function _update() end function _draw() for i=1,6 do print(table[i],127-i*10,cos(i*3/12)*20+60) end end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>With this i have a sinus with my text, but it's not moving in real time, and it's in reverse mode. At some point i need to erase each letter from their previous position ? How to erase only one printed letter ? Print the same letter at the same position with transparent color ? Maybe sprite are better for this because they are easiest to move ?</p> https://www.lexaloffle.com/bbs/?tid=2706 https://www.lexaloffle.com/bbs/?tid=2706 Sun, 01 Nov 2015 16:37:51 UTC