{"id":13744345,"url":"https://github.com/justjoeyuk/Advanced_Joystick","last_synced_at":"2025-05-09T03:31:13.287Z","repository":{"id":6334414,"uuid":"7570008","full_name":"justjoeyuk/Advanced_Joystick","owner":"justjoeyuk","description":"A simple Joystick for the Starling Framework. Great for Mobile Use.","archived":false,"fork":false,"pushed_at":"2015-09-01T14:15:56.000Z","size":589,"stargazers_count":21,"open_issues_count":0,"forks_count":11,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-04T05:03:55.205Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justjoeyuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-12T01:14:31.000Z","updated_at":"2023-10-18T14:11:35.000Z","dependencies_parsed_at":"2022-09-09T03:01:01.610Z","dependency_job_id":null,"html_url":"https://github.com/justjoeyuk/Advanced_Joystick","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/justjoeyuk%2FAdvanced_Joystick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjoeyuk%2FAdvanced_Joystick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjoeyuk%2FAdvanced_Joystick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjoeyuk%2FAdvanced_Joystick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justjoeyuk","download_url":"https://codeload.github.com/justjoeyuk/Advanced_Joystick/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224810977,"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.718Z","updated_at":"2024-11-15T16:30:43.687Z","avatar_url":"https://github.com/justjoeyuk.png","language":"ActionScript","funding_links":[],"categories":["Video Games","User Interface"],"sub_categories":["Game Controller"],"readme":"\u003cdiv align=\"center\"\u003e \u003ch1\u003eWELCOME TO ADVANCED_JOYSTICK\u003ch1\u003e \u003c/div\u003e\n\u003cbr/\u003e\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\u003ch2\u003e\u003cstrong\u003eGetting Started\u003c/strong\u003e\u003c/h2\u003e\u003c/div\u003e\nHey there. If you're reading this, it is likely you are looking for a Joystick solution for Starling. **Well you've \nfound it!**. This Joystick offers features you'd expect from one, and it runs smoothly with the GPU Acceleration that \nStarling provides. To get started, you should:\n\n----\n\n- Download the files from the Repository.\n- Extract the source files to 'starling/extensions/'\n- Check the example project to see how to implement this Joystick.\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\u003ch2\u003e\u003cstrong\u003eUsage\u003c/strong\u003e\u003c/h2\u003e\u003c/div\u003e\n\n\u003ch3\u003eCreation and Initialization\u003c/h3\u003e\nThe code in Advanced Joystick is **very** simple. Now, lets start with adding a simple JoyStick:\n\n\u003cpre\u003e\u003ccode\u003eimport starling.extensions.advancedjoystick.JoyStick;\n\nvar myJoystick:Joystick = new Joystick();\nmyJoystick.setPosition(myJoystick.minOffsetX, clientHeight - myJoystick.minOffsetY);\naddChild(myJoystick);\n\u003c/code\u003e\u003c/pre\u003e\n\nThe above code would initialize the Joystick with the Default Skin. The Joystick will then be positioned at the \nbottom left of the screen since `minOffset` is the total size of the joystick, meaning that it will all be in the \nscreen. The Joystick is then added to the Starling Display List.\n\nIf we wanted to load a JoyStick with a Texture from a `TextureAtlas`, then code similiar to the code below should \nbe used:\n\n\u003cpre\u003e\u003ccode\u003evar holderTexture:Texture = myTextureAtlas.getTexture('joystick_holder');\nvar stickTexture:Texture = myTextureAtlas.getTexture('joystick_stick');\nvar myJoystick:JoyStick = new JoyStick( holderTexture, stickTexture, true );\u003c/code\u003e\u003c/pre\u003e\n\nThis will load a JoyStick which is Custom Skinned. The last parameter is to set whether the JoyStick will start \nworking immediately. If you set this to false, the Joystick can be manually activated by calling `activate()`.\n\n----\n\u003cbr/\u003e\n\u003ch3\u003eMovement and Velocity\u003c/h3\u003e\nNow, for getting the movement from the Joystick, this is also **very** simple. Let's use some simple code to move \na simple object. Let's assume `player` is a Starling Sprite:\n\n\u003cpre\u003e\u003ccode\u003eplayer.x += myJoystick.velocityX * maxSpeed;\nplayer.y += myJoystick.velocityY * maxSpeed;\n\u003c/code\u003e\u003c/pre\u003e\n\nThat's it. Run that code every frame and your object will move according to the Joystick. The values of `velocityX` and \n`velocityY` are returned as normalized values, meaning that the value is between -1 and 1. This is for your benefit as \nyou can multiply this by a maximum value to move and object depending on the distance of the stick from the center of \nthe holder.\n\n----\n\u003cbr/\u003e\n\u003ch3\u003eA few helpful functions\u003c/h3\u003e\nThere are 3, more smaller functions that you should know. These are:\n- `activate();`\n- `deactivate();`\n- `changeSkin( holderTexture, stickTexture );`\n\nThese functions are pretty self-explanitory. If you deactivate the Joystick, touch will not work until it is activated. \nThe `changeSkin()` accepts 2 Starling Textures. I recommend using a Texture Atlas as these are helpful with Memory in \nlarger games. There are plenty of tutorials elsewhere for that.\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\u003ch2\u003e\u003cstrong\u003ePlease Note\u003c/strong\u003e\u003c/h2\u003e\u003c/div\u003e\nIf you are not planning on using the default skin of the Joystick, then please open the file 'JoyStick.as' and then\nCOMMENT OUT these lines of code:\n\n----\n\n\u003cpre\u003e\u003ccode\u003e[Embed( source=\"skins/default_stick.png\" )] private static const dsClassEmbed:Class;\npublic static const DEFAULT_STICK:Texture = Texture.fromBitmap( new dsClassEmbed() );\n[Embed( source=\"skins/default_holder.png\" )] private static const dhClassEmbed:Class;\npublic static const DEFAULT_HOLDER:Texture = Texture.fromBitmap( new dhClassEmbed() );\u003e/code\u003e\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustjoeyuk%2FAdvanced_Joystick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustjoeyuk%2FAdvanced_Joystick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustjoeyuk%2FAdvanced_Joystick/lists"}