当前位置: 首页>>代码示例>>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;未经允许,请勿转载。