Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

align marquee text to the right if not scrolling

Hey, I tried to align a marquee text to the right if it is not scrolling. 

I tried several things but nothing is working..
This is my current code.

 

<use id="progName" href="#marquee-text" font-size="32"
  fill="fb-white" mode="1" value="50">
  <set href="group/text" attributeName="text-buffer" to="" />  
  <set href="group/separator" attributeName="width" to="150" />
</use>

 

 

Could someone help me? 😄

Best Answer
0 Votes
1 REPLY 1

You can add extra blank spaces in left and right and force marquee to scroll. See an example below.

Note: You don't even need to add JavaScript if you have static text, just add white spaces manually.  

 

 

 

<!-- index.gui -->
<use id="progName" href="#marquee-text" font-size="32" fill="fb-white" mode="1" value="50">
  <rect width="100%" height="100%" fill="black" opacity="0" />
  <set href="group/text" attributeName="text-buffer"
    to="............................................................." />
  <set href="group/separator" attributeName="width" to="150" />
</use>

 

 

 

 

// index.js
let marquee = document.getElementById("progName");
let message = "Hello!";
let padding = Math.round((50 - message.length)/2);
marquee.text = " ".repeat(padding) + message + " ".repeat(padding);

 

 

 

 

Best Answer
0 Votes