kaxyum/cameraapi 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kaxyum/cameraapi

Composer 安装命令:

composer require kaxyum/cameraapi

包简介

a Pocketmine-MP API to use CameraPacket

README 文档

README

CameraAPI is an API that makes it easy to use the CameraPacket.

Usage

Install SimplePacketHandler on your server

Register CameraHandler

if(!CameraHandler::isRegistered())
{
    CameraHandler::register($this);
}

Set Camera Instruction

// only the argument preset is compulsory
$setCameraInstruction = new SetCameraInstruction();
$setCameraInstruction->setPreset(CameraPresets::FREE()); //CameraPresets::FIRST_PERSON(), CameraPresets::THIRD_PERSON(), CameraPresets::THIRD_PERSON_FRONT()
$setCameraInstruction->setEase(CameraSetInstructionEaseType::LINEAR, 1);
$setCameraInstruction->setCameraPostion(new Vector3(100, 100, 100));
$setCameraInstruction->setRotation(0, 0);
$setCameraInstruction->setFacingPosition(new Vector3(0, 0, 0));
$setCameraInstruction->send($player);

Fade Camera Instruction

// no argument is compulsory
$fadeCameraInstruction = new FadeCameraInstruction();
$fadeCameraInstruction->setTime(1, 5, 1);
$fadeCameraInstruction->setColor(225, 225, 225);
$fadeCameraInstruction->send($player);

Clear Camera Instruction

// no argument is compulsory
$clearCameraInstruction = new ClearCameraInstruction();
$clearCameraInstruction->setClear(true);
$clearCameraInstruction->send($player);

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-06-30