PocketMine-MP 5.21.3 git-fcef015f32c0b0709cfd4d6f1b3c32f484b25bde
Loading...
Searching...
No Matches
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 @phpstan-param array{0?: string, 1?: string, 2?: string, 3?: string}|null $lines
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 55 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 81 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 117 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 109 of file SignText.php.

◆ getLines()

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

Returns an array of lines currently on the sign.

Returns
string[] @phpstan-return array{0: string, 1: string, 2: string, 3: string}

Definition at line 91 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 125 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: