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

Console Color

Comments in 'Plugin Development' started by Glitchmaster_PE, Oct 23, 2013.

  1. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    Don't know if you guys know this, but I may just be slow :p You can add color to the console text by doing this:

    PHP:
    console(FORMAT_RED."This will be red".FORMAT_RESET);
    the output would be:

    This will be red

    Don't know if you guys knew this. Just thought I'd share
    0becca0 likes this.
  2. Darunia18
    Offline

    Darunia18 Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    754
    Plugins:
    2
    Minecraft User:
    Darunia18
    Cool! Are you able to give a color output in-game or does MCPE not support colors?
  3. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    You can also put this on like a
    $output = FORMAT_RED."blah blah blah".FORMAT_RESET;
    return $output;
  4. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    No, not that I know of
  5. Darunia18
    Offline

    Darunia18 Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    754
    Plugins:
    2
    Minecraft User:
    Darunia18
    Ok. Still, whenever I get the change to start learning php, stuff like this will be useful to me! :D
  6. ZacHack
    Offline

    ZacHack Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    325
    Plugins:
    6
    Minecraft User:
    _ZacHack_
    Does that work with any color? I've been trying to get color and I've been having to use codes like xdh[3m ... Stuff I don't understand but this will be a lot better lol
  7. JassperBeastHD
    Offline

    JassperBeastHD Banned

    Joined:
    Aug 27, 2013
    Posts:
    436
    Minecraft User:
    JassperBeastHD
    Where to out it tho :p
  8. JassperBeastHD
    Offline

    JassperBeastHD Banned

    Joined:
    Aug 27, 2013
    Posts:
    436
    Minecraft User:
    JassperBeastHD
    Does this work with DroidPocketMine
  9. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    Not sure, I have never really worked with Droidpocketmine... I don't think their consoles support color
    I think it probably works with colors like RED, BLUE, GREEN, AQUA, YELLOW, ETC. the main colors, not quite sure though
  10. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    These are just shortcuts to the pocketmine color codes.
    And the pocketmine color codes are shortcuts to the ansi color codes.
    The pocketmine color codes work like the bukkit ones: http://i.imgur.com/yuA46.png but the & symbol is replaced by § (alt + 0167).
    The ansi color codes are for example \x1b[30m for black , you can find more information about the ansi escape codes here: http://en.wikipedia.org/wiki/ANSI_escape_code
    ZacHack likes this.
  11. ZacHack
    Offline

    ZacHack Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    325
    Plugins:
    6
    Minecraft User:
    _ZacHack_
    So with the pocketmine color codes I can do this for example?
    PHP:
    console("§4[Warning]§4");
  12. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    You don't need the second §4, if you use a color code it will color the text after it until there is another color code.
    so for example:
    console("§4Red§2 Green§r Default (grey)§f White");
    ZacHack likes this.
  13. ZacHack
    Offline

    ZacHack Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    325
    Plugins:
    6
    Minecraft User:
    _ZacHack_
    Oh ok thanks!
  14. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    so is it alt and then type those four numbers at the same time?
  15. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    Never used alt codes?
    Hold the alt button and press the number
  16. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    honestly? no. PocketMine plugins were the first real coding I have done
  17. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    I never use it with coding, but I need the alt codes for writing french texts for school (some letters are missing on a qwerty keyboard)
  18. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    yeah, I'm in eight grade, so no foreign languages yet :p
  19. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    Prepare for the worst :p
    I need to learn Dutch(mother tongue)-French-Deutsch-English :(
  20. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    :(

Share This Page

Advertisement