TTF Strange line spacing behavior

  • #1, by bananeisafreeTuesday, 24. May 2016, 19:28 4 years ago
    Hi Everyone.
    How's life treating you ?

    I'm in a bit of a pickle ... I kindof resolved it on my own, but not in a way I judge either clean nor professional.
    So I was wondering if any of you had to deal with something of the sort.

    Here is the problem :

    I'm using a .ttf true font for my game (as they are quite versatile and usefull)
    when using multi line "display text by character" with several "<" p ">" (damn it's hard to make them appear in a post !) used.

    The first "bit" (before the first ) if it has a return will show a line spacing quite ridiculous (cf screenshots)
    the next "bit" won't have the same problem and show a normal spacing.


    I tryed fiddeling around with the line spacing but nothing changed.
    The only way I found to bypass the problem was to put a "blank return" at the beggining of the dialog.
    It works but is kindof (not that much I concede) tidious on the long run.
    Plus it lowers the whole text making it jump around between the first and second "bit" (cf second screenshot) ...


    Any Input ?

    Thanks in advance !

    If I found something on my own, I will post it for tuture Visionaire Generations.

    Have a delightfull day!

    Forum Fan

    120 Posts


  • #2, by bananeisafreeTuesday, 24. May 2016, 20:08 4 years ago
    I kindof resolve the problem using the "max line width" wich does not suffer from the same problem.
    Would still love some input regarding the issue if you got some !

    edit : Scratch that .. it seems to have mess everything up even more ! :p

    Forum Fan

    120 Posts

  • #3, by afrlmeTuesday, 24. May 2016, 21:03 4 years ago
    haha @ edit... this is occurring in vs 4.2.5?

    I thought they had fixed the ttf issues with 4.2.5, unless that's the next update. I could be mistaken. If you are not using 4.2.5 then try disabling shadows & borders as they caused various issues.

    P.S: interesting looking retro pixel sci-fi game. wink

    Imperator

    6842 Posts

  • #4, by bananeisafreeTuesday, 24. May 2016, 23:43 4 years ago
    Yep i'm using 4.2.5
    I've tried messing around with shadows and borders, but it had no effect.
    The very strange thing is that it only occurs on the first "chunk" of the text. Which makes for some quite hilarious text placement during narration. I'll fiddle with it a little more and see what I can do.

    regarding the P.S:
    It's a "proof of concept" my sister and I are working on. A demo"ish" version of a bigger game we are creating. She is responsable for the formidable graphic art. Once we judge it ready enough, we'll release it as a free teaser for what's to come smile.
    spoilers alert :

    it's gonna be in space !

    Forum Fan

    120 Posts

  • #5, by afrlmeWednesday, 25. May 2016, 00:57 4 years ago
    Really? I thought it was going to be an under the sea aquatic platforming game. Oh, well...

    I've not messed around much with the ttf stuff. We tend to keep the texts to a single line & split the texts into multiple display texts if they do end up becoming too long. Have to keep them to a single line anyway as that's all we have space for on the bottom cinematic bar we added.

    Imperator

    6842 Posts

  • #6, by bananeisafreeWednesday, 25. May 2016, 02:26 4 years ago
    Yes I checked the thread with your script. we thought of using something of the sort with portraits and stuff.
    But since my scripting skills are quite lacklusters we went (for the tech demo at least) for the classical LucasArt style.
    It fits the action quite well.

    I finally managed to use your slider script though... So be prepared to see your name in the credits !
    you lucky bastard !

    Forum Fan

    120 Posts

  • #7, by afrlmeWednesday, 25. May 2016, 04:13 4 years ago
    haha... I wonder how many times my name will end up in the credits of peoples games, without me even knowing about said credit. If more people got round to releasing games faster, then it would be quite a fair bit I reckon.

    Which slider script? I believe I rewrote it a while back.

    Imperator

    6842 Posts

  • #8, by sebastianWednesday, 25. May 2016, 08:13 4 years ago
    Weird bug. Did you tewt it out with another ttf font yet? Maybe something strange in the font is producing tgis kind of issue.

    Cool screenshots anyway smile

    Thread Captain

    2337 Posts

  • #9, by bananeisafreeWednesday, 25. May 2016, 09:49 4 years ago
    @AFLRme Quite a lot I imagine!
    The script I'm talking about is the one you modified from einzelkaempfer.
    You published it but never gave the .ved that showed what entries you had to make in Vis to make it work.
    I know for someone with a bit of knowledge it would have been obvious, but I'm a special kind of stupid!
    So I went and dig up the "original" script from einzelkaempfer which came with a .ved. Comparing your two scripts and the differents entries in his .Ved ; I managed to (finaly) understand the whole thing... Or at least enough of it in order to make it work !
    Again nothing big, but it was litteraly my first Scripting involved experience !
    Felt like some kind of Indiana Holmes !
    I even went the extra mile of creating a bit of script myself for a mute buttons !

    @Sebastian.204 I did not, and definitly should !
    I'll keep you updated !
    And your kind comment will be passed down to the artist wink

    Forum Fan

    120 Posts

  • #10, by afrlmeWednesday, 25. May 2016, 11:41 4 years ago
    Ah, sliding interfaces aka Deponia interfaces script? That's a really old method. I refined that after Simon implemented the new shorthand scripting methods as it can now be done with a few lines of code instead of about 100 lines or whatever I used.

    Quick example...
    local int = Interfaces["test"] -- store interface in a variable for quicker access

    if int.InterfaceOffset.y == 1200 then -- query if interface is in closed position
    int:to(1000, { InterfaceOffset = {x = int.InterfaceOffset.x, y = 880}, easeBounceOut) -- slide out with bounce at end
    elseif int.InterfaceOffset.y == 980 then -- query if interface is in open position
    int:to(1000, { InterfaceOffset = {x = int.InterfaceOffset.x, y = 1200}, easeQuintIn) -- slide in with slow start
    end
    1
    2
    3
    4
    5
    6
    7
    8

    ... this would query 2 positions. If interface is in closed position then it would slide it out & if it was in closed position it would slide it back in. It will only work when you use it if the interface is in one of those 2 positions. The reason I can now use a script as short as this is thanks to SimonS implementing both Lua shorthand access & the new tweening functions; especially the to() function which is a lot quicker & easier to use than startObjectTween().

    Quick note: the example above is a script meant to be called, however I recommend writing a global function that allows you to specify the interface you want to affect, the closed & open position values, the direction you want to slide from/to & the easing for closing & opening.

    Imperator

    6842 Posts

  • #11, by sebastianWednesday, 25. May 2016, 12:49 4 years ago
    Wait..
     
    local int = Interfaces["test"] -- store interface in a variable for quicker access

    if int.InterfaceOffset.y == 1200 then -- query if interface is in closed position
    int:to(1000, { InterfaceOffset = {x = int.InterfaceOffset.x, y = 880}, easeBounceOut) -- slide out with bounce at end
    elseif int.InterfaceOffset.y == 980 then -- query if interface is in open position
    int:to(1000, { InterfaceOffset = {x = int.InterfaceOffset.x, y = 1200}, easeQuintIn) -- slide in with slow start
    end
    1
    2
    3
    4
    5
    6
    7
    8
    9

    Is all i need to move interfaces now?
    BEHOLD! AWESOMENESS IS RISING!

    Thread Captain

    2337 Posts

Write post