{"id":13744344,"url":"https://github.com/duckleg/as3dpad","last_synced_at":"2025-05-09T03:31:13.196Z","repository":{"id":4976422,"uuid":"6134289","full_name":"duckleg/as3dpad","owner":"duckleg","description":"as3dpad is a virtual gamepad designed for Adobe AIR mobile. You can develop a iOS/Android game and receive user data from the touch screen. X and Y axis data will be represented to “UP”, “DOWN”, “LEFT”, “RIGHT” and a radians.","archived":false,"fork":false,"pushed_at":"2013-09-18T02:34:14.000Z","size":1544,"stargazers_count":18,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-04T05:03:52.478Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"yi-editor/yi","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duckleg.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":"2012-10-09T02:28:53.000Z","updated_at":"2021-09-10T16:05:06.000Z","dependencies_parsed_at":"2022-08-06T18:00:57.127Z","dependency_job_id":null,"html_url":"https://github.com/duckleg/as3dpad","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duckleg%2Fas3dpad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duckleg%2Fas3dpad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duckleg%2Fas3dpad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duckleg%2Fas3dpad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duckleg","download_url":"https://codeload.github.com/duckleg/as3dpad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224810978,"owners_count":17373897,"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":[],"created_at":"2024-08-03T05:01:07.698Z","updated_at":"2024-11-15T16:30:43.497Z","avatar_url":"https://github.com/duckleg.png","language":"ActionScript","funding_links":[],"categories":["Video Games","User Interface"],"sub_categories":["Game Controller"],"readme":"as3dpad\n=======\nas3dpad is a virtual gamepad designed for Adobe AIR mobile. You can develop a iOS/Android game and receive user data from the touch screen. X and Y axis data will be represented to “UP”, “DOWN”, “LEFT”, “RIGHT” and a radians.\n\n![Explain01](https://sites.google.com/site/ducklegflash/as3dpad/explain01.jpg)\n![Explain02](https://sites.google.com/site/ducklegflash/as3dpad/explain02.jpg)\n\n\n## Features\n\n- X and Y-axis\n- A, B, C and D Buttons\n- custom UI\n- key mapping for development on desktop (WASD + m,./)\n- available with stage3d (e.g.: Starling, Away3D, Alternativa3D...)\n\n## What does work\n\n\nFirst of all, you'll create an instance of the DPad and add to the stage.\n```as3\nvar dPad:DPad = new DPad();\nthis.addChild(dPad);\n````\n\nAdd a detection listener for AxisPad. You'll get values on X and Y-axis.\n```as3\ndPad.leftPad.addEventListener(DPadEvent.TOUCH_PRESS, touchPressHandler);\ndPad.leftPad.addEventListener(DPadEvent.TOUCH_RELEASE, touchReleaseHandler);\n\nprivate function touchPressHandler(event:DPadEvent):void{\n  var axisPad:AxisPad = event.target as AxisPad;\n  trace(\"radians: \" + axisPad.radians);\n  trace(\"distance: \" + axisPad.distance + \"/\" + axisPad.maxDistance);\n  trace(\"press left:  \" + (axisPad.value \u0026 AxisPad.LEFT));\n  trace(\"press right: \" + (axisPad.value \u0026 AxisPad.RIGHT));\n  trace(\"press up:    \" + (axisPad.value \u0026 AxisPad.UP));\n  trace(\"press down:  \" + (axisPad.value \u0026 AxisPad.DOWN));\n}\nprivate function touchReleaseHandler(event:DPadEvent):void{\n  ...\n}\n````\n\nAdd a detection listener for GroupPad. You'll get values on A and B buttons.\n```as3\ndPad.rightPad.addEventListener(DPadEvent.TOUCH_PRESS_A, touchPressAHandler);\ndPad.rightPad.addEventListener(DPadEvent.TOUCH_PRESS_B, touchPressBHandler);\ndPad.rightPad.addEventListener(DPadEvent.TOUCH_RELEASE_A, touchReleaseAHandler);\ndPad.rightPad.addEventListener(DPadEvent.TOUCH_RELEASE_B, touchReleaseBHandler);\n\nprivate function touchPressAHandler(event:DPadEvent):void{\n  var groupPad:GroupPad = event.target as GroupPad;\n  trace(\"press A: \" + (groupPad.value \u0026 GroupPad.A_BUTTON));\n  trace(\"press B: \" + (groupPad.value \u0026 GroupPad.B_BUTTON));\n}\nprivate function touchPressBHandler(event:DPadEvent):void{\n\t...\n}\nprivate function touchReleaseAHandler(event:DPadEvent):void{\n\t...\n}\nprivate function touchReleaseBHandler(event:DPadEvent):void{\n\t...\n}\n````\n\n## Examples\n\n- example01_basic [demo](https://sites.google.com/site/ducklegflash/as3dpad/example01_basic)\n- example02_custom_UI [demo](https://sites.google.com/site/ducklegflash/as3dpad/example02_custom_ui)\n- example03_double_AxisPad [demo](https://sites.google.com/site/ducklegflash/as3dpad/example03_double_axispad)\n- example04_touch9Grid [demo](https://sites.google.com/site/ducklegflash/as3dpad/example04_touch9grid)\n- example05_starling [demo](https://sites.google.com/site/ducklegflash/as3dpad/example05_starling)\n\n[![Launch Examples](https://sites.google.com/site/ducklegflash/as3dpad/ex01.jpg)](https://sites.google.com/site/ducklegflash/as3dpad/example01_basic)\n[![Launch Examples](https://sites.google.com/site/ducklegflash/as3dpad/ex02.jpg)](https://sites.google.com/site/ducklegflash/as3dpad/example02_custom_ui)\n[![Launch Examples](https://sites.google.com/site/ducklegflash/as3dpad/ex03.jpg)](https://sites.google.com/site/ducklegflash/as3dpad/example03_double_axispad)\n[![Launch Examples](https://sites.google.com/site/ducklegflash/as3dpad/ex04.jpg)](https://sites.google.com/site/ducklegflash/as3dpad/example04_touch9grid)\n[![Launch Examples](https://sites.google.com/site/ducklegflash/as3dpad/ex05.jpg)](https://sites.google.com/site/ducklegflash/as3dpad/example05_starling)\n\n(Click the image to see some demos. Be patient, no preloader!)\n\n## Download\n\nSWC Library - [as3dpad.swc](https://github.com/duckleg/as3dpad/tree/master/as3dpad/bin)\n\n## License\n\nCopyright (C) 2012 Marco Wong, http://flash-adobe.blogspot.hk/\n\nLicence Agreement (The MIT License)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduckleg%2Fas3dpad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduckleg%2Fas3dpad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduckleg%2Fas3dpad/lists"}