Skip to content

Line spacing is not constant

The line spacing between two lines of text is changing +/-1 Pixel during scrolling the text! In other words: the line spacing depends on the scroll position. I think this is a wrong calculation from float text positions to the integer based pixel positions. I see this very clearly on my low-res MacBook with 1280x800 Pixel display. Looks awful If some lines of an huge text block jumping up and down during scrolling....

I hope you can fix this easy.

Comments

  • TressetTresset Member, Moderator Posts: 8,268
    I'm no expert on such things so I could be wrong here, but isn't that more of an issue with your computer's specific display setup rather than the game? Maybe someone more tech savvy can back me up on this but I am not entirely sure much can be done about that...
  • LebosteinLebostein Member Posts: 19
    edited December 2013
    I think not. I am a programmer too and I had this same issue by an old game of me.
    It is a bug. If you output a graphic (a letter of a bitmap font in this case) and the position of this letter is calculated by float coordinates, then you have to round up or round down this coordinate to an integer pixel value. And if you calculate every line of a text by its own coordinate, then some y-positions are rounded up, some rounded down. It depends on the scroll position.

    The right way ist to calculate a fixed pixel-offset, that is used for every line to the next line. Then every line have the same spacing to the next.

    For monitor resolutions grater then 800 pixel in y it will not be noticeable so much. But here with 800 pixel in y it disturbs me...
  • TressetTresset Member, Moderator Posts: 8,268
    Ah, ok. Clearly I do not know what I am talking about in this case. Not sure how I would go about reporting this issue either. I'll see if I can find someone who knows about this stuff.
  • LebosteinLebostein Member Posts: 19
    edited December 2013
    In other words:

    If you add the float scroll position with the float text line offset and round the solution of this addition to a pixel coordinate, then you get this effect.

    The easiest way to fix this is to round the scrolling position to an integer BEFORE you add the offset of the text line. Then the spacing between two lines is independent of the scroll position...
    Post edited by Lebostein on
  • Troodon80Troodon80 Member, Developer Posts: 4,110
    A report cannot be created on guesswork. The assumption in this case is that they are, indeed, using float variables instead of integers. If they were using such, then that would probably explain it. However, that would be a call from one of the devs. I'll tag @Avenger_teambg.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    It is more likely rescaling that affects spacing. But i can only guess as well, atm.
Sign In or Register to comment.