1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

big popup text in middle

Discussion in 'Development' started by MrJamesAndrewMC, Apr 17, 2017.

  1. MrJamesAndrewMC

    MrJamesAndrewMC Spider Jockey

    Messages:
    36
    what is the code of this big letter popup on screen??
    Screenshot_20170417-183620.png
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    This should be in the plugin dev section...

    Code (assuming $player is instanceof Player):
    PHP:
    $player->addTitle("Title""subtitle");
    You can also set FadeIn, Stay and FadeOut time:
    e.g.:
    PHP:
    $player->addTitle("Title""subtitle"102030);
    Edit: Forgot a quotation mark
     
    MrJamesAndrewMC likes this.
  3. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    Its called a Title.

    (Assuming $player is an instance of Player)

    PHP:
    $player->addTitle("Title""Subtitle"202020);
    What this all means:

    "Title" - The BIG text displayed
    "Subtitle" - The slightly smaller text displayed under the title
    20 - The amount of ticks it takes for the title to fade in
    20- The amount of time the title stays on the screen for
    20 - The amount of ticks it takes for the title to fade in

    NOTE: The times at the end are optional. Also 20 ticks = 1 second.

    Some examples:
    PHP:
    $player->addTitle("Welcome");
    $player->addTitle("Welcome""To my server");
    $player->addTitle("Welcome"""204020);
    --------------------------

    The small text above the hotbar is called an ActionBar

    PHP:
    $player->addActionBarMessage("Waste money in our shop now!");
    Which is the equivelant of
    PHP:
    $player->sendTip("Why haven't you wasted your money yet?");
    But using action bar is best
     
    Last edited: Apr 17, 2017
    MrJamesAndrewMC likes this.
  4. MrJamesAndrewMC

    MrJamesAndrewMC Spider Jockey

    Messages:
    36
    Thanks for the code
     
  5. MrJamesAndrewMC

    MrJamesAndrewMC Spider Jockey

    Messages:
    36
    i
    really really thanks
     
  6. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    What advantages does Player::sendActionBarMessage() have over Player::sendTip()? I just want to know what the difference is.
     
    jasonwynn10 likes this.
  7. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    To be honest, I have no idea. But sendTip() has the possibility to be removed in newer updates IN FAVOUR of the action bar.

    I've even tried setting custom durations on action bar and it doesn't work, so currently there is no advantages other then the one I stated above.
     
  8. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    The advantage is you can set the duration time directly via the packet instead of having to make a task and all that 'poop' with tips.
     
  9. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    I tried settings action bar duration and it didn't change
     
  10. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    I first tried it with the packet and it worked perfectly fine.
     
  11. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    Do I send the duration packet seperatly
     
  12. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    Yep. You send a packet with TYPE_SET_ANIMATION_TIMES first and then the packet with the action bar message. If that does not work then try sending a single packet with the duration and action bar message.
     
  13. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    What did you do to get it to work?
     
  14. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    Sent a single packet with TYPE_SET_ACTIONBAR_MESSAGE and set the duration (fade in, stay in and fade out time) in seconds.
     
  15. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    In ticks you mean
     
  16. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    Neither of those work.
     
  17. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    Nah, I set it in seconds.
    I don't know, maybe it's just PocketMine cause I tried with a fork before.
     
  18. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    I think its a client bug. I set the fade in to 200 and stay to 800 and it faded in slowly and dissapeared before it even completely appeared
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.