front, l => left, r => right, b => back $x = array('f' => 8, 'l' => 16, 'r' => 0, 'b' => 24); imagecopyresized($dest, $src, 0, 0, $x[$view], 8, $size, $size, 8, 8); // Face imagecolortransparent($src, imagecolorat($src, 63, 0)); // Black Hat Issue imagecopyresized($dest, $src, 0, 0, $x[$view] + 32, 8, $size, $size, 8, 8); // Accessories imagedestroy($src); return $dest; } /** * Check if given texture is occupied * * @param string $hash * @return bool */ public static function checkTextureOccupied($hash) { $db = new Database\Database(); if ($db->getNumRows('hash_steve', $hash) > 1) { return true; } elseif ($db->getNumRows('hash_alex', $hash) > 1) { return true; } elseif ($db->getNumRows('hash_cape', $hash) > 1) { return true; } // finally if given texture is not used by anyone else return false; } }