PHP code example of blessing / texture-renderer

1. Go to this page and download the library: Download blessing/texture-renderer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

blessing / texture-renderer example snippets


use Blessing\Minecraft;

$m = new Minecraft();
$resource = $m->renderSkin($source, /* optional */ $ratio, /* optional */ $isAlex);
$resource = $m->renderCape($source, $height);
$resource = $m->render2dAvatar($source, /* optional */ $ratio);
$resource = $m->render3dAvatar($source, /* optional */ $ratio);

use Blessing\Renderer\SkinRenderer;

$renderer = new SkinRenderer();
$resource = $renderer->render($source, $isAlex);  // returns GD resource

use Blessing\Renderer\CapeRenderer;

$renderer = new CapeRenderer();
$resource = $renderer->render($source, $height);  // returns GD resource

use Blessing\Renderer\TextureUtil;

$isAlex = TextureUtil::isAlex($texture); // returns bool type