{"id":13524827,"url":"https://github.com/MarcoFazioRandom/Virtual-Joystick-Godot","last_synced_at":"2025-04-01T03:32:51.517Z","repository":{"id":41086560,"uuid":"189752537","full_name":"MarcoFazioRandom/Virtual-Joystick-Godot","owner":"MarcoFazioRandom","description":"A simple virtual joystick for touchscreens, for both 2D and 3D games, with useful options.","archived":false,"fork":false,"pushed_at":"2024-09-21T15:38:44.000Z","size":946,"stargazers_count":717,"open_issues_count":1,"forks_count":78,"subscribers_count":18,"default_branch":"Main","last_synced_at":"2024-10-29T17:12:03.456Z","etag":null,"topics":["gdscript","godot","joystick","touchscreen"],"latest_commit_sha":null,"homepage":"","language":"GDScript","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/MarcoFazioRandom.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-01T16:07:06.000Z","updated_at":"2024-10-27T22:11:06.000Z","dependencies_parsed_at":"2024-02-26T23:41:50.870Z","dependency_job_id":"70088164-d6e8-491a-997b-73345321d9e3","html_url":"https://github.com/MarcoFazioRandom/Virtual-Joystick-Godot","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/MarcoFazioRandom%2FVirtual-Joystick-Godot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoFazioRandom%2FVirtual-Joystick-Godot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoFazioRandom%2FVirtual-Joystick-Godot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoFazioRandom%2FVirtual-Joystick-Godot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcoFazioRandom","download_url":"https://codeload.github.com/MarcoFazioRandom/Virtual-Joystick-Godot/tar.gz/refs/heads/Main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222698187,"owners_count":17024877,"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":["gdscript","godot","joystick","touchscreen"],"created_at":"2024-08-01T06:01:13.790Z","updated_at":"2024-11-02T09:30:30.856Z","avatar_url":"https://github.com/MarcoFazioRandom.png","language":"GDScript","funding_links":[],"categories":["Plugins and scripts","GDScript","Stale"],"sub_categories":["3D","Godot"],"readme":"# Godot Virtual Joystick\n\n\u003cimg src=\"addons/virtual_joystick/previews/icon.png\" width=\"200\"\u003e\n\nA simple virtual joystick for touchscreens, with useful options.\n\nGitHub Page: https://github.com/MarcoFazioRandom/Virtual-Joystick-Godot\n\nGodot Engine: https://godotengine.org\n\n## PREVIEWS:\n\n\u003cimg src=\"addons/virtual_joystick/previews/preview1.png\" width=\"300\"\u003e    \u003cimg src=\"addons/virtual_joystick/previews/preview2.png\" width=\"300\"\u003e\n\nEasy to use:\n\n```GDScript\nextends Sprite2D\n\n@export var speed : float = 100\n\n@export var joystick_left : VirtualJoystick\n\n@export var joystick_right : VirtualJoystick\n\nvar move_vector := Vector2.ZERO\n\nfunc _process(delta: float) -\u003e void:\n\t## Movement using the joystick output:\n#\tif joystick_left and joystick_left.is_pressed:\n#\t\tposition += joystick_left.output * speed * delta\n\n\t## Movement using Input functions:\n\tmove_vector = Vector2.ZERO\n\tmove_vector = Input.get_vector(\"ui_left\",\"ui_right\",\"ui_up\",\"ui_down\")\n\tposition += move_vector * speed * delta\n\n\t# Rotation:\n\tif joystick_right and joystick_right.is_pressed:\n\t\trotation = joystick_right.output.angle()\n```\n\n\n## OPTIONS:\n\n- Joystick mode:\n\t- Fixed: The joystick doesn't move.\n\t- Dynamic: Every time the joystick area is pressed, the joystick position is set on the touched position.\n\t- Following: When the finger moves outside the joystick area, the joystick will follow it.\n\n- Dead zone size: If the tip is inside this range the output is zero.\n\n- Clamp zone size: The max distance the tip can reach.\n\n- Visibility mode:\n\t- always: Always visible.\n\t- touchscreen only: Visible on touch screens only (will hide if the device has not a touchscreen).\n\t- when_touched: Visible only when touched.\n\n- Use input actions: if true the joystick will trigger the input actions created in Project -\u003e Project Settings -\u003e Input Map\n\n## HELP:\n- The Control parent of the joystick is the area in which the joystick can move in Dynamic mode.\n- For moving the joystick inside his area, select it, right click, turn on \"Editable Children\" and then change the position of the Base node.\n- With \"Editable Children\" turned on you can also edit the joystick textures and colors.\n- Create a CanvasLayer node and name it \"UI\", it'll contain all the UI elements, then add the Joystick scene as a child of the UI node and move it where you prefer.\n- An example scene is provided in the \"Test\" folder.\n\n## FAQ\n### Multitouch doesn't work / can't use two joystick at the same time:\nIn Godot, the input events from the mouse don't support multitouch, so make sure to have this configuration:  \nProject -\u003e Project Settings -\u003e General -\u003e Input Devices  \n\"emulate touch from mouse\" ON  \n\"emulate mouse from touch\" OFF  \n\n### The joystick doesn't work when using Input.get_vector():\n⚠ **This has been fixed in Godot Engine 4.2.1**  \nUnfortunately, this a bug in the Godot engine, so the only solution for now is using Input.get_axis:  \nThis doesn't work:\n```gdscript\ninput_vector := Input.get_vector(\"ui_left\",\"ui_right\",\"ui_up\",\"ui_down\")\n```  \nThis works:\n```gdscript\ninput_vector := Vector2.ZERO\ninput_vector.x = Input.get_axis(\"ui_left\", \"ui_right\")\ninput_vector.y = Input.get_axis(\"ui_up\", \"ui_down\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarcoFazioRandom%2FVirtual-Joystick-Godot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMarcoFazioRandom%2FVirtual-Joystick-Godot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarcoFazioRandom%2FVirtual-Joystick-Godot/lists"}