Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Display popup on top screen

Comments in 'Plugin Development' started by IcePL, Mar 26, 2016.

  1. IcePL
    Offline

    IcePL New Member

    Joined:
    Feb 16, 2016
    Posts:
    73
    Minecraft User:
    IcePL
    Hi is it possible to display a popup or tip on top of the screen ?
    And how to make it if this is possible?
  2. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Could be more specific? I don't get it...
  3. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Code:
    ooooooooo                  pppppppppp
    
                 Top popup
    
    
              Player::sendTip()
    
    
             Player::sendPopup()
            ____________________
            [][][][][][][][][][]
    
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    sendMesage().

    I'm serious. Add spaces at the beginning of the message. Hack with packets to convert every single message into an array of messages that have the height of a client screen such that the bottom message will always be your padded string while the lines above will be normal chat.
    This is possible. But how will it look? Terrible.
  5. WitherTube
    Offline

    WitherTube New Member

    Joined:
    Dec 21, 2015
    Posts:
    44
    Minecraft User:
    Wither_Tube
    PHP:
    $this->sendPopup("Example");
    Hey
    my Methods to send a pop is :
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    1. Whats $this ? (In which context you are)
    2. On TOP of the screen not above hotbar
    3. I only see one method and thats wrong one anyway
    Muqsit likes this.
  7. WitherTube
    Offline

    WitherTube New Member

    Joined:
    Dec 21, 2015
    Posts:
    44
    Minecraft User:
    Wither_Tube
    Sorry
    i mean it in a function like this :

    PHP:
    public function onExample(PlayerJoinEvent $event){
    $this->sendPopup("Example");
    }

  8. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Again wrong.
    PHP:
    public function onExample(PlayerJoinEvent $event){
        
    $event->getPlayer()->sendPopup("Example");
    }
  9. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    [​IMG]
    So is this possible in 0.14 using your idea?
  10. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    That is from PC minecraft... Not possible to show big letters in MCPE
    Muqsit likes this.
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Make the player stand still, spawn FloatingTextParticle for a few seconds
    HotFireyDeath and Muqsit like this.
  12. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    But as you can see, there's no floating text particle there! Just text! I'd that possible? Plus, if you're very close to a floating text particle, it won't be visible :/
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    If your player is standing still already, just use FloatingTextParticle.
    If your player is moving or may be moving, you can't, unless you try the sendMessage() trick.
    Muqsit likes this.
  14. XShockinFireX
    Offline

    XShockinFireX New Member

    Joined:
    Jan 28, 2016
    Posts:
    14
    Minecraft User:
    XShockinFireX
    This is possible with sendTip().
    $player->sendTip("Text\n\n\n\n\n\n");
  15. MikkiMCPE
    Offline

    MikkiMCPE Active Member

    Joined:
    May 16, 2015
    Posts:
    125
    Minecraft User:
    MikkiMC
    \n is break line
  16. XShockinFireX
    Offline

    XShockinFireX New Member

    Joined:
    Jan 28, 2016
    Posts:
    14
    Minecraft User:
    XShockinFireX
    I know that, I have tested this code and it works, that is the purpose of a break line.
  17. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Yes it works, but keep in mind: The position of the popup message depends on the GUI size, while your popup is on top of your screen, tablet users with big GUI size will actually see it in the middle of screen. So I recommend you to test it.
  18. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    In my opinion it would be nice if clients were passing this information, screen and GUI size, in the LoginPacket. Why not? That's only few bytes of data to sent.
    MikkiMCPE, MyNameIsTriXz and Survingo like this.
  19. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Yes, hopefully. It would be useful if you want to make virtual info bars (that right bar on MCPC used by minigames to show information). I hope they add it or set that the display position doesnt change by the gui size.

Share This Page

Advertisement