How to scroll text like "credits"

Discussion in 'Rebol' started by MaxV, Mar 15, 2011.

  1. MaxV

    MaxV Member

    Hello everybody,
    I'd like to scroll text like "credits" in a movie or in a videogame.
    I read the following example:
    http://cyphre.mysteria.cz/agg-demo-01.r

    but I didn't realize how it works and how to make the background transparent
  2. MaxV

    MaxV Member

    I found this, but also title scroll... why? With omething
    Code:
    names: "long long list"
    view layout [
    vh1 "Hello to:"
    nm: vtext names rate 1  feel [engage: func [face action event][
       nm/para/scroll: nm/para/scroll + 0x-10
       show face
       ]]
    ]
    
    also vh1 scroll...
  3. Graham

    Graham Developer Staff Member

    What's the question?
  4. swhite

    swhite Member

    I think the basic question is, how does one display a long item of text, too long to fit in a window, so that it automatically scrolls from top to bottom, slowly, without human intervention. Like the "less" command on the Amiga of days gone by, if that has any meaning.

    On a deeper level, in my opinion, is the question of the lost genius in undocumented code. If my understanding of the basic question is correct, I look at the two code samples, and I don't see how they work. Someone else did, because he wrote the code, but his information/insight/genius is gone because his code can't be understood.

    Remember that the above comments are coming from a REBOL beginner. Others may see it differently.
  5. Graham

    Graham Developer Staff Member

    swhite, I thought you had worked out how a scroller works before. What you see is just a viewport on to a larger canvas or pane.
  6. swhite

    swhite Member

    Yes, I did, I'm not complaining. I am discovering that one CAN teach an old dog new tricks, but the old dog just can't REMEMBER them. If I were the one trying to solve this problem, I would go back and refer to that prior question where I figured it out.

    Interestingly, I just checked my computer to see if I kept any samples or notes or commented code locally about that issue. It appears that while I talk a good line about documentation and so on, I don't practice what I preach.
  7. MaxV

    MaxV Member

    Well, I solved adding para[], wihtout it all VID elements are in some way grouped.
    Code:
    names: "long long list"
    view layout [
    vh1 "Hello to:"
    nm: vtext names font [valign: 'top] para [] rate 1  feel [engage: func [face action event][
       nm/para/scroll: nm/para/scroll + 0x-10
       show face
       ]]
    ]
    
    Now, my other problem is: how to preserve formatting?
    if names is like:
    Code:
    names: {
    Max V
    Graham
    swhite
    }
    
    any VID element tends to join the text this way
    Code:
    names: {Max V Graham swhite}
    
    It doesn't keep the newline, any suggestions?
  8. MaxV

    MaxV Member

    Look at this:
    http://www.rebol.com/docs/view-face-content.html
    and then (when you absorbed it), these:
    http://www.rebol.com/docs/view-face-events.html
    http://www.rebol.com/how-to/feel.html
  9. MaxV

    MaxV Member

    SOLVED!!!
    VID form text string deleting newlines, but after we can update the face/text attribute and no "removing newline" is applied, so:
    Code:
    names: {
    Max V
    Graham
    swhite
    }
    view layout [
    vh1 "Hello to:"
    nm: vh1 "" 120x300 font [valign: 'top] para [] rate 2  feel [engage: func [face action event][
       if face/text = "" [face/text: names]
       face/para/scroll: face/para/scroll + 0x-1
       show nm
       ]]
    ]
    

Share This Page