ManaPHP\Image\Adapter\Gd::text PHP Метод

text() публичный Метод

Execute a text
public text ( string $text, integer $offsetX, integer $offsetY, float $opacity = 1, integer $color, integer $size = 12, string $font_file = null ) : static
$text string
$offsetX integer
$offsetY integer
$opacity float
$color integer
$size integer
$font_file string
Результат static
    public function text($text, $offsetX = 0, $offsetY = 0, $opacity = 1.0, $color = 0x0, $size = 12, $font_file = null)
    {
        $textColor = imagecolorallocatealpha($this->_image, $color >> 16 & 0xff, $color >> 8 & 0xff, $color & 0xff, abs(1 - $opacity) * 127);
        if ($font_file) {
            imagettftext($this->_image, $size, 0, $offsetX, $offsetY, $textColor, $this->alias->resolve($font_file), $text);
        } else {
            imagestring($this->_image, $size, $offsetX, $offsetY, $text, $textColor);
        }
        return $this;
    }