{"id":16553236,"url":"https://github.com/allejo/bzflag-rendering.php","last_synced_at":"2025-09-07T12:41:55.243Z","repository":{"id":42029269,"uuid":"267237611","full_name":"allejo/bzflag-rendering.php","owner":"allejo","description":"A library for rendering thumbnails of BZFlag worlds","archived":false,"fork":false,"pushed_at":"2022-04-18T07:24:04.000Z","size":396,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"0.2","last_synced_at":"2024-08-11T09:54:54.906Z","etag":null,"topics":["bzflag","php","svg"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allejo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-27T06:21:12.000Z","updated_at":"2024-02-03T10:04:47.000Z","dependencies_parsed_at":"2022-08-12T02:50:35.974Z","dependency_job_id":null,"html_url":"https://github.com/allejo/bzflag-rendering.php","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allejo%2Fbzflag-rendering.php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allejo%2Fbzflag-rendering.php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allejo%2Fbzflag-rendering.php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allejo%2Fbzflag-rendering.php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allejo","download_url":"https://codeload.github.com/allejo/bzflag-rendering.php/tar.gz/refs/heads/0.2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219859002,"owners_count":16556039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bzflag","php","svg"],"created_at":"2024-10-11T19:47:31.645Z","updated_at":"2024-10-11T19:47:32.287Z","avatar_url":"https://github.com/allejo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BZFlag Rendering\n\n[![Packagist](https://img.shields.io/packagist/v/allejo/bzflag-rendering.php.svg)](https://packagist.org/packages/allejo/bzflag-rendering.php)\n[![Code coverage](https://codecov.io/gh/allejo/bzflag-rendering.php/branch/0.2/graph/badge.svg?token=OBO8JGRPHJ)](https://codecov.io/gh/allejo/bzflag-rendering.php)\n[![License](https://img.shields.io/github/license/allejo/bzflag-rendering.php.svg)](LICENSE.md)\n\nA PHP 7.1+ package for drawing BZFlag related things such as map thumbnails; this is a sister project to [bzflag-networking.php](https://github.com/allejo/bzflag-networking.php).\n\n## Installation\n\nThis package can be installed via [Composer](https://getcomposer.org).\n\n```bash\ncomposer require allejo/bzflag-rendering.php\n```\n\n## Usage\n\nThis library currently supports exporting maps as SVGs or PNGs. Using the `WorldRenderer` class, you can give it a `WorldDatabase` instance from version 1.1+ of `bzflag-networking.php`.\n\n```php\n// use allejo\\bzflag\\graphics\\PNG\\Radar\\WorldRenderer;\nuse allejo\\bzflag\\graphics\\SVG\\Radar\\WorldRenderer;\nuse allejo\\bzflag\\replays\\Replay;\n\n$replay = new Replay('official-match.rec');\n$world = $replay-\u003egetHeader()-\u003egetWorldDatabase();\n\n$renderer = new WorldRenderer($world);\n\necho $renderer-\u003ewriteToFile(\"thumbnail.svg\");\n```\n\n### Namespaces in this package\n\nThis package is dedicated to drawing and rendering BZFlag related images or files, meaning this will have dependencies for drawing. In order to allow these dependencies to be \"opt-in,\" it is a separate package.\n\nHowever, the namespace of this project is shared with its sister project. The namespaces available in this package are the following:\n\n- `allejo\\bzflag\\graphics`\n\n## Examples\n\nHere are some examples of SVG images generated by this library.\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003cimg\n                src=\"./examples/hix.svg\"\n                alt=\"Radar thumbnail of HiX\"\n            /\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003cimg\n                src=\"./examples/random_map.svg\"\n                alt=\"Radar thumbnail of a random map\"\n            /\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003cimg\n                src=\"./examples/pillbox.svg\"\n                alt=\"Radar thumbnail of Pillbox\"\n            /\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003cimg\n                src=\"./examples/unknown_mini.svg\"\n                alt=\"Radar thumbnail of Unknown Mini\"\n            /\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Obstacle Drawing Support\n\nThis project currently has support for drawing the following BZW 2.x object types.\n\n| Object Type | Support            |\n|:------------|:-------------------|\n| arc         | :x:                |\n| base        | :white_check_mark: |\n| box         | :white_check_mark: |\n| cone        | :x:                |\n| group       | :white_check_mark: |\n| mesh        | :white_check_mark: |\n| pyramid     | :white_check_mark: |\n| sphere      | :x:                |\n| teleporter  | :white_check_mark: |\n| tetra       | :x:                |\n\n## License\n\n[MIT](./LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallejo%2Fbzflag-rendering.php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallejo%2Fbzflag-rendering.php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallejo%2Fbzflag-rendering.php/lists"}