Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
superhighfives

Ignore spaces in ScrambleText

Recommended Posts

Hey folks,

 

I'm using ScrambleTextPlugin with a wrapping paragraph of text:

 

Working across design, development and
interactive media, I build interfaces, websites,
applications and open source experiments
using web technologies.

 

Currently there's no way to ignore spaces while scrambling, which means the last word of each sentence flicks between each line. For example:

 

Working across design, development
and interactive media, I build interfaces,
websitesaoxooxoxxxoxxoooooxoxxxooxooxxoxxx
xooxxxxoxooxooxxxooxxoooxxxxox

 

Because the word website is tied to the remaining scrambled string.

 

I believe ignoring spaces could solve that issue:

 

Working across design, development and
interactive media, I build interfaces, xoxoxoxox
xoxoxoxoxxox xox oxox xxooxo xooxxoxoxox
xoxox xox oxoxoxxoxoxox

 

I have looked in the source, but I haven't been able to find a place where I could loop through the string before it is passed to the DOM. My goal would be to do something like the following (pseudo-code):

 

if(actualText[indexOfLetter] === " ") {

  awesomeScrambledText[indexOfLetter] = " ";

}

 

Any advice would be really appreciated, and I'd love to add something like this into the actual plugin.

 

If anyone has any suggestions that'd be awesome.

 

Cheers,

Charlie.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×