Download the PHP package ninjaknights/drawerapi without Composer

On this page you can find all versions of the php package ninjaknights/drawerapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package drawerapi

DrawerAPI

GitHub license GitHub stars GitHub forks GitHub issues Github downloads


DrawerAPI is a PocketMine-MP virion designed to draw shapes and text in the world using the PrimitiveShapesPacket.
View on Microsoft Docs
View on Packagist


Setup

Before using the API, you must register it in your plugin’s onLoad() or onEnable() method:


Creating Shapes

You can draw various shapes using the provided shape classes.

➤ TextShape

➤ CircleShape

➤ CubeShape (Debug Cube)

This does not generate a ID


Available Shapes

Shape Description
Text Renders a floating text label
Arrow Renders a directional arrow
Box Renders a 3D bounding box
Line Renders a straight line between points
Sphere Renders a full sphere
Circle Renders a circle or polygon
Cube Renders a DebugCube shape

Available Colors

You can use color names, enum, or hex codes (e.g. "red", "light_gray", "#ff0000", "f0f0f0").
All names are case-insensitive.

Color Name Hex Code Enum
white #f0f0f0 ShapeColor::WHITE
orange #f9801d ShapeColor::ORANGE
magenta #c74ebd ShapeColor::MAGENTA
light_blue #3ab3da ShapeColor::LIGHT_BLUE
yellow #fed83d ShapeColor::YELLOW
lime #80c71f ShapeColor::LIME
pink #f38baa ShapeColor::PINK
gray #474f52 ShapeColor::GRAY
light_gray #9d9d97 ShapeColor::LIGHT_GRAY
cyan #169c9c ShapeColor::CYAN
purple #8932b8 ShapeColor::PURPLE
blue #3c44aa ShapeColor::BLUE
brown #835432 ShapeColor::BROWN
green #5e7c16 ShapeColor::GREEN
red #b02e26 ShapeColor::RED
black #1d1d21 ShapeColor::BLACK

Managing Shapes

➤ Clear Shapes

You can clear all shapes of a specific type for a viewer or world using the clearAll method:

➤ Remove Specific Shape by ID

➤ Remove CubeShape


ID Management

➤ Get ID List

➤ Check if an ID is Active

➤ Get Last Generated ID


API Reference

➤ DrawerAPI Methods

Method Description
register(PluginBase $plugin) Initializes and registers the DrawerAPI. Required before use.
isRegistered(): bool Returns true if the API is initialized.
getColor(?string $color): Color Converts a color name or hex or enum (e.g., "red", "#ff0000", "ShapeColor::WHITE") to a Color object.
getId(ShapeType $type): int Gets the last generated ID for a shape type.
isActiveId(ShapeType $type, int $id): bool Checks if an ID is currently active.
getIdList(ShapeType $type): array<int> Lists all currently active IDs for a shape type.
removeId(ShapeType $type, int $id): void Manually unregisters an ID (usually done automatically).
clearAll(World\|Player $viewer, ?ShapeType $type): void Despawns and removes all shapes of a specific type or all types.
despawnPacketByID(World\|Player $viewer, int $id): void Removes a single shape from view by its ID.
sendPacket(World\|Player $viewer, PrimitiveShapesPacket $packet): void Sends a custom packet to a player or world.

➤ ShapeColor Methods

Method Description
ShapeColor::fromString(string $name): ?ShapeColor Converts a color name into a ShapeColor enum. Returns null if invalid.
ShapeColor::("COLOR")->toColor(): Color Converts the enum value to a pocketmine\color\Color instance.
ShapeColor::("COLOR")->name Returns the constant name (e.g., WHITE, RED, etc.).
ShapeColor::("COLOR")->value Returns the constant value (e.g., white, red, etc.).

Notes


📄 License

This project is licensed under the GPL-3.0 License.


📬 Contact


All versions of drawerapi with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ninjaknights/drawerapi contains the following files

Loading the files please wait ...