{"id":13995414,"url":"https://github.com/JarWarren/Joystick","last_synced_at":"2025-07-22T21:32:49.594Z","repository":{"id":46788065,"uuid":"231252726","full_name":"JarWarren/Joystick","owner":"JarWarren","description":"A Joystick class for use with SpriteKit. Drag and drop to install. Converts the user's touches to a Direction.","archived":false,"fork":false,"pushed_at":"2020-01-01T23:01:17.000Z","size":19889,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-10T14:19:19.883Z","etag":null,"topics":["game","ios","joystick","mobile","spritekit","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JarWarren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-01T19:00:20.000Z","updated_at":"2024-01-02T23:22:45.000Z","dependencies_parsed_at":"2022-07-26T17:32:28.235Z","dependency_job_id":null,"html_url":"https://github.com/JarWarren/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/JarWarren%2FJoystick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JarWarren%2FJoystick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JarWarren%2FJoystick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JarWarren%2FJoystick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JarWarren","download_url":"https://codeload.github.com/JarWarren/Joystick/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227177958,"owners_count":17743211,"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":["game","ios","joystick","mobile","spritekit","swift"],"created_at":"2024-08-09T14:03:23.510Z","updated_at":"2024-11-29T17:31:43.201Z","avatar_url":"https://github.com/JarWarren.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Joystick\n\n*An 8-directional joystick class that sends updates to a delegate. Drag and drop to install. Does not come with assets.*\n\n*I needed a joystick for a SpriteKit demo I was building and couldn't find anything online.*\n*I hope that by uploading it to github, someone else may be able to benefit from the way I implemented it - or perhaps even use it directly in their own project.*\n![Joystick Demo](Joystick_Demo.gif)\n\n### Explanation\n\nMy HUD is built in UIKit and sends user input via the delegate pattern.\nJoystick is a subclass of UIImageView that reads user touches, determines where in itself they occured, and translates them into a direction.\n\nThe delegate is only notified when the direciton changes, so that the hero can react accordingly. If the user lets go of the joystick, the delegate receives a `nil` direction. An opportunity to \"idle\" your hero.\n\n.\n\n### Installation\n1. Drag and drop both Swift files into your project.\n2. Add a `UIImageView` to your storyboard and subclass it as a `Joystick`.\n3. Check the box that says `User Interaction Enabled`. (Or set `isUserInteractionEnabled = true` in Swift).\n4. Create an outlet and in `viewDidLoad()`, set your ViewController as the joystick's delegate.\n5. Conform to `JoystickDelegate`.\n\n*Feel free to make any edits you want. (Ex. rotate a single asset instead of providing one for each direction.)*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJarWarren%2FJoystick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJarWarren%2FJoystick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJarWarren%2FJoystick/lists"}