當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Human::setSkin方法代碼示例

本文整理匯總了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);
     }
 }
開發者ID:NewDelion,項目名稱:PocketMine-0.13.x,代碼行數:7,代碼來源:Player.php

示例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);
     }
 }
開發者ID:ZenaGamingsky,項目名稱:Steadfast2,代碼行數:7,代碼來源:Player.php

示例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);
     }
 }
開發者ID:PepbookPvP,項目名稱:Genisys,代碼行數:7,代碼來源:Player.php

示例4: setSkin

 public function setSkin($str, $isSlim = false)
 {
     parent::setSkin($str, $isSlim);
     if ($this->spawned) {
         $this->respawnToAll();
     }
 }
開發者ID:richarrj,項目名稱:PocketMine-MP,代碼行數:7,代碼來源:Player.php

示例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);
     }
 }
開發者ID:TexusDark,項目名稱:ImagicalMine,代碼行數:7,代碼來源:Player.php

示例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;
 }
開發者ID:DWWf,項目名稱:pocketmine-plugins,代碼行數:47,代碼來源:SkinUtils.php

示例7: setSkin

 public function setSkin($str, $isSlim = false)
 {
     parent::setSkin($str, $isSlim);
     if ($this->spawned === true) {
         $this->despawnFromAll();
         $this->spawnToAll();
     }
 }
開發者ID:TylerGames,項目名稱:PocketMine-MP,代碼行數:8,代碼來源:Player.php

示例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);
 }
開發者ID:happyexceed,項目名稱:PocketMine-Plugins-1,代碼行數:9,代碼來源:SkinConverter.php

示例9: setSkin

 public function setSkin($str, $skinname)
 {
     parent::setSkin($str, $skinname);
     if ($this->spawned) {
         $this->server->sendFullPlayerListData($this);
     }
 }
開發者ID:ajreimine,項目名稱:PocketMine-0.13.x,代碼行數:7,代碼來源:Player.php

示例10: setSkin

 public function setSkin($str, $isSlim = false, $isTransparent = false)
 {
     parent::setSkin($str, $isSlim, $isTransparent);
     if ($this->spawned) {
         $this->server->sendFullPlayerListData($this);
     }
 }
開發者ID:NewDelion,項目名稱:PocketMine-0.13.x,代碼行數:7,代碼來源:Player.php


注:本文中的pocketmine\entity\Human::setSkin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。