定制 rogiel/star-map 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

rogiel/star-map

Composer 安装命令:

composer require rogiel/star-map

包简介

A StarCraft II map parser in PHP

README 文档

README

This library allows you to read StarCraft II map files from PHP.

A object-oriented API is provided to browse through the metadata and the minimap image.

Features

  • Read .SC2Map files from all public game versions
  • Minimap: Allows to read the embeded minimap image

Installation

The recommended way of installing this library is using Composer.

composer require "rogiel/star-map"

This library uses php-mpq to parse and extract compressed information inside the map file.

Example

use Rogiel\StarMap\Map;

// Parse the map
$map = new Map('Ruins of Seras.SC2Map');

// Get the map name in multiple locales
$documentHeader = $map->getDocumentHeader();

echo sprintf('Map name (English): %s', $documentHeader->getName()).PHP_EOL; // english is default
echo sprintf('Map name (French): %s', $documentHeader->getName('frFR')).PHP_EOL;

// Get the map size
$mapInfo = $map->getMapInfo();
$x = $mapInfo->getWidth();
$y = $mapInfo->getHeight();
echo sprintf('Map size: %sx%s', $x, $y).PHP_EOL;

// Export Minimap image as a PNG
$map->getMinimap()->toPNG('Minimap.png');

The output to the snippet above is the following:

Map name (English): Ruins of Seras
Map name (French): Ruines de Seras
Map size: 224x192

Have fun!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-2.0
  • 更新时间: 2016-07-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固