[Util] String Scroller (with colours!)

Discussion in 'Resources' started by Chinwe, Oct 19, 2013.

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

    DrJava

    The Gaming Grunts
    I do not believe it's possible to use this with scoreboard scores.
     
  2. Offline

    sgavster

    DrJava Wrong. :p It works fine
     
    Zarko likes this.
  3. Offline

    DrJava

    sgavster Not for scores. It creates multiple scores.
     
  4. Offline

    sgavster

    DrJava I do this:

    Code:
    Scroller pol = new Scroller("&2Online Players", 16, 3, '&');
    Scroller olp = new Scroller("&6" + all(), 14, 5, '&');
    ScoreboardAdd.addScore(j, pol.next(), olp.next(), 5, 4);
        public static final void addScore(Objective j, String name, String info, int x, int y)
        {
         
            Score s = j.getScore(Bukkit.getOfflinePlayer(name));
            s.setScore(x);
         
            Score s1 = j.getScore(Bukkit.getOfflinePlayer(info));
            s1.setScore(y);
        }
    
    Works fine for me :p
     
    GrandmaJam likes this.
  5. Offline

    RainoBoy97

    Because it supports multiple colors per string :) But BOLD and a color may bug out a little, nothing major though!
     
    GrandmaJam likes this.
  6. Offline

    Flybelette

    Hi ! Do you know how to "cancel" a Scroller ? Thanks :p
     
  7. Offline

    DrJava

    Ahh,I see.

    this.cancel();?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  8. Offline

    Flybelette

    I mean, just change the Scroller text without cancel the BukkitRunnable :)
     
  9. Offline

    DrJava

    Change the scrolling text..

    English, please?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  10. Offline

    MoeMix

    iKeirNez Yeah why not just ChatColor.translateall("&", <string>);?....dont get too complicated with a lazy person liek meh :p. or wait is that compatible?
     
  11. Offline

    gal0511Dev

    It dosent scroll for me can i get help please
    http://prntscr.com/3foubv
    Code:java
    1. ItemStack ncoins = new ItemStack(Material.EMERALD, 1);
    2. ItemMeta ncoinsname = ncoins.getItemMeta();
    3. ncoinsname.setDisplayName("§bYour coins:");
    4. ArrayList<String> lore = new ArrayList<String>();
    5. Scroller coins = new Scroller("&6Scrollll", 4, 10, '&');
    6. lore.add(coins.next());
    7. lore.add(ChatColor.GREEN + "Coins: " + ChatColor.AQUA + NetworkPoints.getBalance(p.getName()));
    8. lore.add(coins.next());
    9. ncoinsname.setLore(lore);
    10. ncoins.setItemMeta(ncoinsname);
     
    GrandmaJam likes this.
  12. Offline

    SoThatsIt

    (facepalm)

    why are there always stupid people with stupidly simple problems on everything :mad:
     
    GrandmaJam and Skyost like this.
  13. Offline

    gal0511Dev

    so how do i do it?
     
  14. Offline

    SoThatsIt

    firstly, your scoller is pointless because all of the characters in it are the same.
    Secondly, the next() method just returns the string scrolled by 1, in order to make it scroll you would have to make a scheduler which runs every x ticks and then in there get all the items you need to scroll there lore on and update their lore using the next() method again.
     
    Skyost likes this.
  15. Offline

    HeavyMine13


    Chinwe
    This does not work:
    Code:java
    1. Scroller scroller = new Scroller("§lWelcome to My Happy Server :D", 12, 3, '§');
    2. String welcome = (String) scroller.next();
     
Thread Status:
Not open for further replies.

Share This Page