本文整理汇总了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);
}
}