1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Maps with Image

Discussion in 'Development' started by NutXzG, Jul 9, 2022.

  1. NutXzG

    NutXzG Baby Zombie

    Messages:
    132
    GitHub:
    NutXzG
    I want create map with image on api 4.0 but i don't know how to make it
     
  2. TacoError

    TacoError Spider

    Messages:
    7
    GitHub:
    TacoError
    https://github.com/CzechPMDevs/ImageOnMap/tree/main#API

    If you look here, this plugin supports api 4.0.0 and has a api for putting images on maps.

    Example usage
    PHP:
    $api = \czechpmdevs\imageonmap\ImageOnMap::getInstance();
    $id $api->getImageFromFile(
        
    file"path/to/image.png",
        
    xChunkCount1,
        
    yChunkCount1,
        
    xOffset0,
        
    yOffset0
    );
    $map = (FilledMap::get())->setMapId($id);
    $player->getInventory()->addItem($map);
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.