Attract-Mode Support > Scripting

Help in getting Scrolling Text to go RIGHT and/or VERTICAL

(1/1)

pacman_fan:
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!

pacman_fan:
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,
-------------------

jakabasej8:

--- Quote from: 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!

--- End quote ---
Feels like a demo reel with commitment issues

Navigation

[0] Message Index

Go to full version