Automatic calculating of Offscreen positions of scrolling Text



  • Hello Community,

    I try to get a automated calculation with the javascript  actor. Maybe someone can help me with this. I think I need a usable mathematical formula for this.
    1\. What I already have:
    I want text in the Text Drawer to be scrolled vertically or horizontally. The Text scrolling should be starting and stopping Offscreen.
    This is already working, if I try to find the right Offscreen values in the Text Draw actors horiz pos and vert pos, by trying manually and give it to the envelope generator.
    2\. What I want:
    I want to calculate the scrolling end positions automatically by a javascript actor. The Basics are the font size, the number of characters (if scrolled horiz.)/rows (if scrolled vert.) and a factor based on the font size.
    3\. My Issue:
    I can't really find a working factor that is exactly enough to get the appropriate results.
    An Example (I tried to get an factor by checking the results at certain values)
    Text ist Numbers by 1 up to 100, 1 Number per row, giving 100 rows.
    Value "vert align" is set to "top" meaning row 1 is at top screen if "vert pos" is set to 0, and just offscreen if "vert pos" is at 100.
    "bounds" are set to 0 and all other values are default.
    font size | manual value of "vert pos" if last row is gone offscreen (not including +100 because of starting offscreen) | % of discrepancy to the factor 1: -111
    | -111 | 0%
    1,1 | -138,6 | 13,51%
    1,2 | -138,6 | 4,05%
    1,5 | -166,5 | 0%
    2 | -249,6 | 12,43%
    5 | -582 | 4,86%
    10 | -1165 | 5,81%
    50 | -5739 | 3,41%
    100 | -11480 | 3,3%
    As you can see, there is no exact linear consistency as there are discrepancies of several percentages.
    What is this related to? Is it a bug, or do I miss something?
    Does anyone have an Idea?!
    Thanks,
    Dill

  • Tech Staff

    You might have better luck if you try to work with a monospace font, otherwise each character will be of varying width.

    Heres a listing of a few: http://hivelogic.com/articles/top-10-programming-fonts/


  • Hello DusX,

    thank you for your advise. I had this in mind for the horizontal scrolling.
    But the example I gave is about vertical scrolling. I'm aware that maybe different fonts does have different hight within the same "font size" value.
    But if you use the same font in different sizes (as done in the example) shouldn't the rows have the same size each!?
    Especially as "font size" is defined as "The hight of the characters, expressed as a percentage of the hight of the frame"?!

Log in to reply
 

Looks like your connection to TroikaTronix Community Forum was lost, please wait while we try to reconnect.