PocketMine-MP 5.15.1 git-fb9a74e8799c71ed8292cfa53abe7a4c9204629d
pocketmine\block\utils\SignText Class Reference
+ Collaboration diagram for pocketmine\block\utils\SignText:

Public Member Functions

 __construct (?array $lines=null, ?Color $baseColor=null, bool $glowing=false)
 
 getBaseColor ()
 
 getLine (int $index)
 
 getLines ()
 
 isGlowing ()
 

Static Public Member Functions

static fromBlob (string $blob, ?Color $baseColor=null, bool $glowing=false)
 

Public Attributes

const LINE_COUNT = 4
 

Detailed Description

Definition at line 36 of file SignText.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\block\utils\SignText::__construct ( ?array  $lines = null,
?Color  $baseColor = null,
bool  $glowing = false 
)
Parameters
string[] | null$linesindex-sensitive; keys 0-3 will be used, regardless of array order
Exceptions

InvalidArgumentException if the array size is greater than 4

Exceptions

InvalidArgumentException if invalid keys (out of bounds or string) are found in the array

Exceptions

InvalidArgumentException if any line is not valid UTF-8 or contains a newline

Definition at line 51 of file SignText.php.

Member Function Documentation

◆ fromBlob()

static pocketmine\block\utils\SignText::fromBlob ( string  $blob,
?Color  $baseColor = null,
bool  $glowing = false 
)
static

Parses sign lines from the given string blob. TODO: add a strict mode for this

Exceptions

InvalidArgumentException if the text is not valid UTF-8

Definition at line 77 of file SignText.php.

◆ getBaseColor()

pocketmine\block\utils\SignText::getBaseColor ( )

Returns the base text color of sign. Color codes using the ยง escape character will override this color when used.

Definition at line 112 of file SignText.php.

◆ getLine()

pocketmine\block\utils\SignText::getLine ( int  $index)

Returns the sign line at the given offset.

Exceptions

InvalidArgumentException

Definition at line 104 of file SignText.php.

◆ getLines()

pocketmine\block\utils\SignText::getLines ( )

Returns an array of lines currently on the sign.

Returns
string[]

Definition at line 86 of file SignText.php.

◆ isGlowing()

pocketmine\block\utils\SignText::isGlowing ( )

Returns whether the sign text is glowing. When true, the text will have an outline (usually a darker tone of the base color, or white for black text), and will glow in the dark, making it readable without any light sources.

Definition at line 120 of file SignText.php.

Member Data Documentation

◆ LINE_COUNT

const pocketmine\block\utils\SignText::LINE_COUNT = 4

Definition at line 37 of file SignText.php.


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