Scoreboard resizing as text scrolls

Discussion in 'Plugin Development' started by CoderMusgrove, May 28, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    CoderMusgrove

    I have created a function in which the display name for a scoreboard objective will scroll in a loop. Okay, well that's done, but now there's one problem left. As the text scrolls, the scoreboard will resize according to the text width, and it really hurts the eyes. As an example, I see that MinePlex has this issue fixed with their scoreboard.

    My guess on how to fix it was the find all of the characters with certain widths that aren't like the rest of the characters, like "!", "i", and ",". Then, I would find each index of it, then find the remainder after dividing by two, and then adding that to the front of the display name

    Code:
    int thinChars = substring.substring("!").length + substring.substring("i").length + substring.substring(",").length;
    At this point, it helps to smooth it out just the slightest bit, but it's still not working the best. My guess now is that all of the characters have different widths, and I have no idea how I would fix this. As well, I cannot really figure out any measurements for widths of certain characters. How would I keep my scoreboard from having the width resize as I change the display name?
     
  2. Offline

    The Fancy Whale

    To fix this make the scoreboard the max size by adding a blank person with " " (Not sure how many spaces there should be) then the scoreboard will always be the max size
     
    CoderMusgrove likes this.
Thread Status:
Not open for further replies.

Share This Page