{"id":17967786,"url":"https://github.com/yunyoujun/cocos-creator-joystick","last_synced_at":"2025-04-09T23:16:50.979Z","repository":{"id":104055041,"uuid":"179481714","full_name":"YunYouJun/cocos-creator-joystick","owner":"YunYouJun","description":"🕹 Cocos Creator Joystick Demo 虚拟摇杆","archived":false,"fork":false,"pushed_at":"2021-03-07T16:36:22.000Z","size":2670,"stargazers_count":241,"open_issues_count":2,"forks_count":90,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T23:16:49.398Z","etag":null,"topics":["cocos-creator","demo","input-handler","joystick"],"latest_commit_sha":null,"homepage":"https://yunyoujun.github.io/cocos-creator-joystick/","language":"TypeScript","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/YunYouJun.png","metadata":{"files":{"readme":"README.en.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,"governance":null},"funding":{"github":["YunYouJun"]}},"created_at":"2019-04-04T11:10:22.000Z","updated_at":"2025-03-10T06:42:51.000Z","dependencies_parsed_at":"2023-09-26T03:29:35.890Z","dependency_job_id":"bab56785-0167-4891-93ec-0169ec3a21a9","html_url":"https://github.com/YunYouJun/cocos-creator-joystick","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":"0.040000000000000036","last_synced_commit":"bd48c8a79bbb3b5fd084b42fbe333baa6c189109"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YunYouJun%2Fcocos-creator-joystick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YunYouJun%2Fcocos-creator-joystick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YunYouJun%2Fcocos-creator-joystick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YunYouJun%2Fcocos-creator-joystick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YunYouJun","download_url":"https://codeload.github.com/YunYouJun/cocos-creator-joystick/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125593,"owners_count":21051771,"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":["cocos-creator","demo","input-handler","joystick"],"created_at":"2024-10-29T14:09:42.449Z","updated_at":"2025-04-09T23:16:50.955Z","avatar_url":"https://github.com/YunYouJun.png","language":"TypeScript","funding_links":["https://github.com/sponsors/YunYouJun"],"categories":[],"sub_categories":[],"readme":"# cocos-creator-joystick\n\n\u003e Cocos Creator Joystick Demo\n\n- [Version 0.2.0](https://github.com/YunYouJun/cocos-creator-joystick/releases/tag/v0.2.0) for Cocos Creator 3.0\n- [Version 0.1.0](https://github.com/YunYouJun/cocos-creator-joystick/releases/tag/v0.1.0) for TypeScript (Cocos Creator 2.x)\n- [Version 0.0.2](https://github.com/YunYouJun/cocos-creator-joystick/releases/tag/v0.0.2) for JavaScript (Cocos Creator 2.x)\n\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/YunYouJun/cocos-creator-joystick?style=social)](https://github.com/YunYouJun/cocos-creator-joystick/releases)\n[![Cocos Creator version](https://img.shields.io/badge/Cocos_Creator-v3.x-blue.svg?style=social\u0026logo=cocos)](https://www.cocos.com/creator)\n![GitHub top language](https://img.shields.io/github/languages/top/YunYouJun/cocos-creator-joystick.svg?style=social\u0026logo=typescript)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/YunYouJun/cocos-creator-joystick.svg?style=social\u0026logo=visual-studio-code)\n\n[中文文档](./README.md) | English Docs\n\nOnline Preview: [cocos-creator-joystick](https://yunyoujun.github.io/cocos-creator-joystick)\n\n## Usage\n\n### Downoload\n\n[Releases](https://github.com/YunYouJun/cocos-creator-joystick/releases)\n\n### By import\n\n\u003e Cocos Creator v3.x -\u003e File -\u003e Export assets ... -\u003e Choose -\u003e assets/demo.fire\n\u003e Cocos Creator v3.x -\u003e File -\u003e Import assets ...\n\n### By git\n\n```sh\ngit clone https://github.com/YunYouJun/cocos-creator-joystick.git\n```\n\nOpen with `Cocos Creator 3.x`.\n\nYou can see it in `demo.fire` scene.\n\n\u003e Go through the main menu Developer -\u003e VS Code Workflow -\u003e Update VS Code API Source to complete the update about `creator.d.ts`.\n\n## Function\n\n- Joystick Type\n  - [x] Fixed\n  - [x] Follow\n- Player\n  - [x] rotation\n  - [x] move\n- Touch Place (custom Joystick width and height)\n  - [x] Full Screen\n  - [x] Half Screen\n- Decoupling between nodes (only need to monitor Touch events, without mounting the Player node to Joystick, can control many Players)\n\n### Joystick\n\n| Argument     | Type                                     | Default            | Description              | Customizable |\n| ------------ | ---------------------------------------- | ------------------ | ------------------------ | ------------ |\n| joystickType | JoystickType.FIXED / JoystickType.FOLLOW | JoystickType.FIXED | types of joystick        | √            |\n| ring         | cc.Node                                  | -                  | joystick background node | √            |\n| dot          | cc.Node                                  | -                  | joystick control node    | √            |\n\n### Player\n\n| Argument    | Type                                               | Default                    | Description                   | Controled by Joystick | Customizable |\n| ----------- | -------------------------------------------------- | -------------------------- | ----------------------------- | --------------------- | ------------ |\n| rigidbody   | boolean                                            | false                      | Rigidbody (Physics) mode      | ×                     | x            |\n| moveDir     | Vec2                                               | cc.v2(0, 1) // straight up | initial direction of movement | √                     | √            |\n| \\_speedType | SpeedType.STOP / SpeedType.NORMAL / SpeedType.FAST | SpeedType.NORMAL           | speed type                    | √                     | ×            |\n| \\_moveSpeed | cc.Integer                                         | 0                          | speed of movement             | ×                     | ×            |\n| stopSpeed   | cc.Integer                                         | 0                          | speed when stop               | ×                     | √            |\n| normalSpeed | cc.Integer                                         | 100                        | normal speed                  | ×                     | √            |\n| fastSpeed   | cc.Integer                                         | 200                        | fast speed                    | ×                     | √            |\n\n## Structure\n\n\u003e assets/script\n\n| Filename    | Description     | Function                                                                                                     |\n| ----------- | --------------- | ------------------------------------------------------------------------------------------------------------ |\n| Joystick.js | Joystick Script | store joystick main logic (include some type definitions and global events listen)                           |\n| Player.js   | Player Script   | listen events emitted by Joystick (You can customize it.)                                                    |\n| UI.js       | UI              | provide switch joystick type function for online preview（You can delete it directly if you don't need it.） |\n\n## Other\n\nStar, [`Issues`](https://github.com/YunYouJun/cocos-creator-joystick/issues) and `Pull requests` are welcome.\n\n[Recommended coding standards](https://docs.cocos.com/creator/manual/en/scripting/reference/coding-standards.html)\n\n## Dev\n\n### Build\n\n```sh\nnpm run build\n```\n\n### Deploy\n\n```sh\nnpm run deploy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyunyoujun%2Fcocos-creator-joystick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyunyoujun%2Fcocos-creator-joystick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyunyoujun%2Fcocos-creator-joystick/lists"}