PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
pocketmine\utils\TextFormat Class Reference
+ Collaboration diagram for pocketmine\utils\TextFormat:

Static Public Member Functions

static tokenize ($string)
 
static clean ($string)
 
static toJSON ($string)
 
static toHTML ($string)
 
static toANSI ($string)
 

Public Attributes

const BLACK = "§0"
 
const DARK_BLUE = "§1"
 
const DARK_GREEN = "§2"
 
const DARK_AQUA = "§3"
 
const DARK_RED = "§4"
 
const DARK_PURPLE = "§5"
 
const GOLD = "§6"
 
const GRAY = "§7"
 
const DARK_GRAY = "§8"
 
const BLUE = "§9"
 
const GREEN = "§a"
 
const AQUA = "§b"
 
const RED = "§c"
 
const LIGHT_PURPLE = "§d"
 
const YELLOW = "§e"
 
const WHITE = "§f"
 
const OBFUSCATED = "§k"
 
const BOLD = "§l"
 
const STRIKETHROUGH = "§m"
 
const UNDERLINE = "§n"
 
const ITALIC = "§o"
 
const RESET = "§r"
 

Detailed Description

Class used to handle Minecraft chat format, and convert it to other formats like ANSI or HTML

Definition at line 27 of file TextFormat.php.

Member Function Documentation

static pocketmine\utils\TextFormat::clean (   $string)
static

Cleans the string from Minecraft codes and ANSI Escape Codes

Parameters
string$string
Returns
mixed

Definition at line 70 of file TextFormat.php.

static pocketmine\utils\TextFormat::toANSI (   $string)
static

Returns a string with colorized ANSI Escape codes

Parameters
$string
Returns
string

Definition at line 385 of file TextFormat.php.

static pocketmine\utils\TextFormat::toHTML (   $string)
static

Returns an HTML-formatted string with colors/markup

Parameters
string | array$string
Returns
string

Definition at line 269 of file TextFormat.php.

static pocketmine\utils\TextFormat::toJSON (   $string)
static

Returns an JSON-formatted string with colors/markup

Parameters
string | array$string
Returns
string

Definition at line 81 of file TextFormat.php.

static pocketmine\utils\TextFormat::tokenize (   $string)
static

Splits the string by Format tokens

Parameters
string$string
Returns
array

Definition at line 59 of file TextFormat.php.


The documentation for this class was generated from the following file: