Location: PHPKode > projects > PhpBlock > A9.8/modules/basicfog/basicfogfactory.class.php
<?php
include_once $PATH_TO_CODE."/script/fonction.php";

class BasicFogFactory {
    public function getFogImage($parBlock) {
        $parArrayOfDataType = array();
        $locBlockUniqueString = $parBlock->getUniqueString($parSize, $parArrayOfDataType);
        $locBlockImagePath = $locImageManager->getImagePath($parBlock->blockId, 0, $locBlockUniqueString);
        $locImgBlock = imagecreatefrompng($locBlockImagePath);
        if($locImgBlock) {
            if($parBlock->isSurface()) {
                $locBlurImagePath = "plain-";
                $locMergeFactor = 85;
            } else {
                $locBlurImagePath = "underground-";
                $locMergeFactor = 80;
            }
            //rand(0, 4)
            $locBlurImagePath = "${locBlurImagePath}0.png";
            $locImgFlou = imagecreatefrompng("$PATH_TO_CODE/modules/basicfog/image/$locBlurImagePath");
            imagecopymerge($locImgBlock, $locImgFlou, 0, 0, 0, 0, $parSize, $parSize, $locMergeFactor);
        }
    }
}
?>
Return current item: PhpBlock