本文整理匯總了PHP中pocketmine\entity\Human::setSkin方法的典型用法代碼示例。如果您正苦於以下問題:PHP Human::setSkin方法的具體用法?PHP Human::setSkin怎麽用?PHP Human::setSkin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pocketmine\entity\Human
的用法示例。
在下文中一共展示了Human::setSkin方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setSkin
public function setSkin($str, $skinname = "", $isOldClient = false, $isSlim = false, $isTransparent = null)
{
parent::setSkin($str, $skinname, $isOldClient, $isSlim, $isTransparent);
if ($this->spawned) {
$this->server->sendFullPlayerListData($this);
}
}
示例2: setSkin
public function setSkin($str, $isSlim = false)
{
parent::setSkin($str, $isSlim);
if ($this->spawned === true) {
$this->server->updatePlayerListData($this->getUniqueId(), $this->getId(), $this->getDisplayName(), $isSlim, $str);
}
}
示例3: setSkin
public function setSkin($str, $skinName)
{
parent::setSkin($str, $skinName);
if ($this->spawned) {
$this->server->updatePlayerListData($this->getUniqueId(), $this->getId(), $this->getDisplayName(), $skinName, $str);
}
}
示例4: setSkin
public function setSkin($str, $isSlim = false)
{
parent::setSkin($str, $isSlim);
if ($this->spawned) {
$this->respawnToAll();
}
}
示例5: setSkin
public function setSkin($str, $isSlim = false, $skinTransparency = false)
{
parent::setSkin($str, $isSlim, $skinTransparency);
if ($this->spawned) {
$this->server->updatePlayerListData($this->getUniqueId(), $this->getId(), $this->getDisplayName(), $isSlim, $str, null, $skinTransparency);
}
}
示例6: loadSkin
/**
* Load skin
* @param Human $human
* @param bool $slim
* @param str $fn
* @return bool
*/
public static function loadSkin(Human $human, $slim, $fn)
{
if (self::isPngExt($fn)) {
if (!extension_loaded("gd")) {
return false;
}
if (!self::isSkinFile($fn)) {
return false;
}
$img = imagecreatefrompng($fn);
if ($img === false) {
return false;
}
$bytes = "";
$x = $y = 0;
while ($y < 32) {
$rgb = imagecolorat($img, $x, $y);
$r = $rgb >> 16 & 0xff;
$g = $rgb >> 8 & 0xff;
$b = $rgb & 0xff;
$bytes .= chr($r) . chr($g) . chr($b) . chr(255);
$x++;
if ($x === 64) {
$x = 0;
$y++;
}
}
imagedestroy($img);
echo "BYTES=" . strlen($bytes) . "\n";
//##DEBUG
$human->setSkin($bytes, $slim);
return true;
}
$bin = file_get_contents($fn);
if ($bin === false) {
return false;
}
$human->setSkin(zlib_decode($bin), $slim);
return true;
}
示例7: setSkin
public function setSkin($str, $isSlim = false)
{
parent::setSkin($str, $isSlim);
if ($this->spawned === true) {
$this->despawnFromAll();
$this->spawnToAll();
}
}
示例8: setSlim
/**
* Converts a human's skin to slim(32x64) if $slim is true, if $slim is false it will convert to non-slim(64x64)
* @param Human $human
* @param bool $slim
*/
public static function setSlim(Human $human, $slim = true)
{
$human->setSkin($human->getSkinData(), $slim);
}
示例9: setSkin
public function setSkin($str, $skinname)
{
parent::setSkin($str, $skinname);
if ($this->spawned) {
$this->server->sendFullPlayerListData($this);
}
}
示例10: setSkin
public function setSkin($str, $isSlim = false, $isTransparent = false)
{
parent::setSkin($str, $isSlim, $isTransparent);
if ($this->spawned) {
$this->server->sendFullPlayerListData($this);
}
}