Download the PHP package cosmicpe/maprender without Composer

On this page you can find all versions of the php package cosmicpe/maprender. 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 maprender

MapRender

A library for rendering a topographic view of sections within a world in PocketMine-MP.

A render of a few world regions from a PocketMine-MP server

Features

Usage

MapRender uses SOF3/await-generator to perform rendering asynchronously. A MapRender instance may be initialized once and reused. MapRender is stateless, meaning you may invoke MapRender::render() concurrently. render() returns a GdImage which gives you the ability to export the image as needed, or perhaps further preprocess the image. See examples for a few ways you can use this. Coordinate parameters $x1, $x2, $z1, and $z2 are chunk coordinates (not to be confused with block coordinates).

If you are unfamiliar with await-generator and are looking for a quick setup, use Await::f2c() to make a callback wrapper.

Examples

If you are working with block coordinates, use Chunk::COORD_BIT_SIZE to infer chunk coordinates. The example below renders a 176x176 image (((radius x 2) + 1) * 16) where the center chunk is the spawn chunk of the default world.

If you are looking to transport data and hence need to export map image as raw PNG bytes, pass an in-memory stream instead of a file path.

By default, every block is represented as a 1x1 pixel. This means a map spanning 5x5 chunks has a resolution of 80x80. You can use imagescale() to rescale the image. The example below scales the image by 4x (meaning each block is represented using 4x4 pixels).

MapRender has default performance settings to ensure server load is kept minimum and at the same time maps render as quickly as possible. If these settings do not suit your server hardware, tweak them by creating a custom MapRender.

Sample rendered output


All versions of maprender with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
pocketmine/pocketmine-mp Version ^5.0.0
sof3/await-generator Version ^3.6.1
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 cosmicpe/maprender contains the following files

Loading the files please wait ...