{"id":16858950,"url":"https://github.com/liabru/matter-wrap","last_synced_at":"2025-03-22T06:31:25.167Z","repository":{"id":57292604,"uuid":"81737282","full_name":"liabru/matter-wrap","owner":"liabru","description":"a coordinate wrapping plugin for matter-js","archived":false,"fork":false,"pushed_at":"2017-07-04T23:06:40.000Z","size":5239,"stargazers_count":34,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T13:35:56.815Z","etag":null,"topics":["matter-js","plugin","wrap"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/liabru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-12T15:50:07.000Z","updated_at":"2025-03-08T16:04:53.000Z","dependencies_parsed_at":"2022-08-27T16:51:04.850Z","dependency_job_id":null,"html_url":"https://github.com/liabru/matter-wrap","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liabru%2Fmatter-wrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liabru%2Fmatter-wrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liabru%2Fmatter-wrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liabru%2Fmatter-wrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liabru","download_url":"https://codeload.github.com/liabru/matter-wrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244189792,"owners_count":20412991,"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":["matter-js","plugin","wrap"],"created_at":"2024-10-13T14:15:42.134Z","updated_at":"2025-03-22T06:31:20.455Z","avatar_url":"https://github.com/liabru.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# matter-wrap\n\n\u003e A coordinate wrapping plugin for [matter.js](https://github.com/liabru/matter-js/)\n\n[![Build Status](https://travis-ci.org/liabru/matter-wrap.svg?branch=master)](https://travis-ci.org/liabru/matter-wrap)\n\nThis plugin allows you to automatically wrap the position of bodies and composites such that they always stay within the given bounds. Upon crossing a boundary the body will appear on the opposite side of the bounds, while maintaining its velocity.\nAn example of this effect can be seen in the classic \n[Asteroids](https://www.youtube.com/watch?v=WYSupJ5r2zo) and [Pacman](https://youtu.be/3-C7lHLFLU8?t=63) games.\n\n## Demo\n\nSee the [demo](http://liabru.github.io/matter-wrap).\n\n[![matter-wrap](docs/demo.gif)](http://liabru.github.io/matter-wrap)\n\n## Install\n\nGet the [matter-wrap.js](build/matter-wrap.js) file directly or get it via npm:\n\n    npm install matter-wrap\n\n### Dependencies\n\n- [matter.js](https://github.com/liabru/matter-js/)\n\n## Usage\n\n```js\nMatter.use('matter-wrap');\n// or\nMatter.use(MatterWrap);\n```\n\nSee [Using Plugins](https://github.com/liabru/matter-js/wiki/Using-plugins#using-plugins) for more information.\n\nAn example of a body that wraps between the bounds (0, 0) and (1024, 1024).\nFor wrapping composites set `composite.plugin.wrap` as below.\n\n```js\nvar body = Matter.Bodies.circle(0, 0, 10, {\n  plugin: {\n    wrap: {\n      min: {\n        x: 0,\n        y: 0\n      },\n      max: {\n        x: 1024,\n        y: 1024\n      }\n    }\n  }\n);\n```\n\n## Examples\n\nCheck out the [examples](docs/examples).\n\n## Documentation\n\nSee the [API docs](API.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliabru%2Fmatter-wrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliabru%2Fmatter-wrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliabru%2Fmatter-wrap/lists"}