PHP code example of borodin-vasiliy / php-stories

1. Go to this page and download the library: Download borodin-vasiliy/php-stories 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/ */

    

borodin-vasiliy / php-stories example snippets




use BorodinVasiliy\Stories;

$stories = new Stories([
        "width" => $stories_width,
        "height" => $stories_height,
        "duration" => $stories_duration
    ]);




$stories->addImage([
    "path" => __DIR__."image/cat.jpg",
    /*params*/
]);




$stories->addText([
    "text" => "Hello world!",
    "path" => __DIR__."/fonts/helvetica.ttf",
    "size" => 130,
    /*other params*/
]);




$stories->addRectangle([
    "width" => 100,
    "height" => 100,
    /*other params*/
]);




$stories->addEllipse([
    "width" => 100,
    "height" => 100,
    /*other params*/
]);




$stories->addImage([
        /* image params */
    ])->addAnimation([
        /* params for animation */
    ]);




$file_hash = $stories->generate(__DIR__."/tmp");