Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: pacman_fan on February 23, 2025, 06:11:08 PM
-
I just starting using this feature and love it!
But my text is only scrolling Right to Left, and Horizontal Bounce works also.
But i'm unable to get Horizontal_Right and any of the Vertical options to function.
Even when using the sample object scrolling layout included, The Horiztonal_Right and Vertical examples all scroll Right to Left.
I've searched this forun as best i can, but unable to find out what i'm doing wrong.
Any advice?
Thank you all!
-
Apparently the public code was designed to only support HORIZONTAL_LEFT and HORIZONTAL_BOUNCE. It would have been nice if it had been documented that was the case!
In any event, I'm sure there's a better way to update the scrollingnet.nut module, but here's what I came up with, enjoy:
Change:
add = function( text, x, y, w, h, scroll_type = ScrollType.HORIZONTAL_LEFT ) {
to:
add = function( text, x, y, w, h, scroll_type ) {
-------------------
Just before the //create a scrolling text object section:
Add this:
// Support for all Scroll Functions
local scroll_dir = "";
if ( scroll_type == ScrollType.HORIZONTAL_LEFT ) scroll_dir = "left";
if ( scroll_type == ScrollType.HORIZONTAL_RIGHT ) scroll_dir = "right";
if ( scroll_type == ScrollType.HORIZONTAL_BOUNCE ) scroll_dir = "left";
if ( scroll_type == ScrollType.VERTICAL_UP ) scroll_dir = "up";
if ( scroll_type == ScrollType.VERTICAL_DOWN ) scroll_dir = "down";
if ( scroll_type == ScrollType.VERTICAL_BOUNCE ) scroll_dir = "up";
//create a scrolling text object
...
...
-------------------
Change:
_dir = "left",
to:
_dir = scroll_dir,
-------------------