{"id":18271328,"url":"https://github.com/zaldzbugz/ZJoystick","last_synced_at":"2025-04-05T01:31:23.706Z","repository":{"id":147744902,"uuid":"1526251","full_name":"zaldzbugz/ZJoystick","owner":"zaldzbugz","description":"Cocos2D Joystick API v1.3","archived":false,"fork":false,"pushed_at":"2012-02-01T18:08:08.000Z","size":1188,"stargazers_count":47,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-05T11:53:55.629Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://zframework.ph/cocos2d-zjoystick-api/","language":"Objective-C","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/zaldzbugz.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.zjoystick","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-03-25T16:32:31.000Z","updated_at":"2022-01-18T01:57:23.000Z","dependencies_parsed_at":"2023-03-26T02:01:55.878Z","dependency_job_id":null,"html_url":"https://github.com/zaldzbugz/ZJoystick","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/zaldzbugz%2FZJoystick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaldzbugz%2FZJoystick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaldzbugz%2FZJoystick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaldzbugz%2FZJoystick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaldzbugz","download_url":"https://codeload.github.com/zaldzbugz/ZJoystick/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276043,"owners_count":20912286,"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-11-05T11:39:14.067Z","updated_at":"2025-04-05T01:31:18.697Z","avatar_url":"https://github.com/zaldzbugz.png","language":"Objective-C","funding_links":[],"categories":["etc"],"sub_categories":[],"readme":"-------------------------------------------------------------\n//COCOS2D ZJoystick API (Version1.3)\n[Version 1.3 Updates]\n1.) Added new protocol method:\n-(void)joystickControlDidUpdate:(id)joystick toXSpeedRatio:(CGFloat)xSpeedRatio toYSpeedRatio:(CGFloat)ySpeedRatio\nThis protocol method is used to acquire the ZJoystick object itself, XSpeed and YSpeed ratio.\n2.) Added \"joystickTag\" variable; this is used to identify which joystick is controlling. Used in our new protocol method implementation.\nSee example below:\n\n-(void)joystickControlDidUpdate:(id)joystick toXSpeedRatio:(CGFloat)xSpeedRatio toYSpeedRatio:(CGFloat)ySpeedRatio{\n    //cast ZJoystick class to joystick parameter to gain actual class object\n    ZJoystick *zJoystick = (ZJoystick *)joystick;\n    \n    //we only move this object if the joystick controlling is the 999th tagged joystick.\n    if (zJoystick.joystickTag == 999) {\n        CGFloat xPos = globalSprite.position.x;\n        CGFloat yPos = globalSprite.position.y;\n        globalSprite.position = ccp(xPos + xSpeedRatio, yPos + ySpeedRatio); \n    }\n}\n3.) Modified some methods to be more readable\n4.) Updated MyJoystick example.\n5.) Added MIT License\n-------------------------------------------------------------\n//COCOS2D ZJoystick API (Version1.2)\n[Version 1.2 Updates]\n1.) Updated protocol declaration\n2.) Updated protocol method calls\n3.) Added variable to set values for Joystick Radius\n-------------------------------------------------------------\n//COCOS2D ZJoystick API (Version1.1)\n[Version 1.1 Updates]\n1.) Updated the API to allow more than one joysticks in a screen to control   object(s).\n2.) Added ccTouchCancelled that calls the ccTouchEnded to allow other joysticks to work (Thanks to Joey Hengst for pointing this out)\n-------------------------------------------------------------\n//COCOS2D ZJoystick API (Version1.0)\n//Interface and Implementation Files (REQUIRED)\nZJoystick.h - joystick interface file\nZJoystick.m - joystick implementation file\n\n//Sample Image files used in the example code below \nbackground.png - screen background\nJoystick_norm.png - (Our Joystick)\nJoystickContainer_trans.png - rest state (Joystick Container, serves as the Joystick background)\nJoystickContainer_norm.png - active state (Joystick Container, serves as the Joystick background)\n\n-------------------------------------------------------------\nHOW TO USE\n\n1.) import Joystick header file -\u003e #import \"ZJoystick.h\"\n2.) Add \u003cZJoystickDelegate\u003e in the interface declaration\n3.) then add these codes below to any of your scenes\n\n//------------------------------------------------------START------------------------------------------------\n\n//Controlled Object\nCCSprite *controlledSprite  = [CCSprite spriteWithFile:@\"Joystick_norm.png\"];\ncontrolledSprite.position   = ccp(winSize.width/2, winSize.height/2);   \n[self addChild:controlledSprite];\n        \n//Joystick\nZJoystick *_joystick\t= [ZJoystick joystickNormalSpriteFile:@\"JoystickContainer_norm.png\" selectedSpriteFile:@\"JoystickContainer_trans.png\" controllerSpriteFile:@\"Joystick_norm.png\"];\n_joystick.position\t= ccp(_joystick.contentSize.width/2, _joystick.contentSize.height/2);\n_joystick.delegate\t= self;\t\t\t\t//Joystick Delegate\n_joystick.controlledObject  = controlledSprite;     //we set our controlled object which the blue circle\n_joystick.speedRatio         = 2.0f;                //we set speed ratio, movement speed of blue circle once controlled to any direction\n_joystick.joystickRadius     = 50.0f;               //Added in v1.2\n[self addChild:_joystick];\n\n//----------------------------------------------------END----------------------------------------------------\n\n//JoystickDelegate\n//ZJoystick also has three delegate methods that you could use\n-(void)joystickControlBegan;\n-(void)joystickControlMoved;\n-(void)joystickControlEnded;\n\n//You can implement any of these protocol methods if you want.\n\n-------------------------------------------------------------------------------------------------------------\n\nHERE WE GO!\n\n//You can see the blue circle at the center and the joystick at the lower left corner\n//try controlling the joystick and you can see this blue circle moving as you please.\n\n\n//ZIP file\nAdded a ZIP file there (MyJoystick.zip) which is a sample project that you could use.\n\nCheck the blog post tutorial on how to use ZJoystick: \nhttp://zaldzbugz.posterous.com/first-article\n\n\nZaldzBugz\nzbnb@yahoo.com\nhttp://zaldzbugz.posterous.com\nhttp://twitter.com/zaldzbugz","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaldzbugz%2FZJoystick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaldzbugz%2FZJoystick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaldzbugz%2FZJoystick/lists"}