{"id":27946870,"url":"https://github.com/dmccuskey/dmc-gestures","last_synced_at":"2025-05-07T13:58:28.236Z","repository":{"id":26985890,"uuid":"30449686","full_name":"dmccuskey/dmc-gestures","owner":"dmccuskey","description":"Gesture Recognizer library for the Corona SDK","archived":false,"fork":false,"pushed_at":"2015-05-11T12:27:47.000Z","size":486,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T13:58:24.915Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"docs.davidmccuskey.com/dmc-gestures","language":"Lua","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/dmccuskey.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":"2015-02-07T08:10:53.000Z","updated_at":"2018-09-28T08:17:10.000Z","dependencies_parsed_at":"2022-08-31T21:46:14.957Z","dependency_job_id":null,"html_url":"https://github.com/dmccuskey/dmc-gestures","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmccuskey%2Fdmc-gestures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmccuskey%2Fdmc-gestures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmccuskey%2Fdmc-gestures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmccuskey%2Fdmc-gestures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmccuskey","download_url":"https://codeload.github.com/dmccuskey/dmc-gestures/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252892523,"owners_count":21820647,"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":"2025-05-07T13:58:27.665Z","updated_at":"2025-05-07T13:58:28.228Z","avatar_url":"https://github.com/dmccuskey.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dmc-gestures\n\n\n`dmc-gestures` is a module for creating Gesture Recognizers which will watch for gestures performed on an object. The module is modeled after iOS Gesture Recognizers.\n\nThis module is also included in the more comprehensive [DMC Corona Library repo](https://github.com/dmccuskey/DMC-Corona-Library).\n\n\n## General Usage\n\n\nThe touch object can be used as either the controller which just accepts touch events or additionally as the object _being_ controlled. The difference really depends on your touch handler and _to which_ object it applies a gesture's values, either the original view or a separate object.\n\nThere are examples of both found in the repo directory `examples`.\n\n\n### Simple gesture handling\n\n\nThis example just displays the gesture event:\n\n```lua\n-- setup some constants to make placement easier\nlocal W, H = display.contentWidth, display.contentHeight\nlocal H_CENTER, V_CENTER = W*0.5, H*0.5\n\n-- import the gesture library\nlocal Gesture = require 'dmc_corona.dmc_gestures'\n\n-- setup our touch area for the gesture\nlocal view = display.newRect( H_CENTER, V_CENTER+40, V_CENTER, V_CENTER )\n\n-- create our handler, looking for event GESTURE\nlocal function gestureEvent_handler( event )\n\t-- print( \"gestureEvent_handler\" )\n\tif event.type == event.target.GESTURE then\n\t\t\"Gesture: \"..tostring( event.gesture )\n\tend\nend\n\n-- add a tap gesture, using the defaults (single tap, single touch)\nlocal tap = Gesture.newTapGesture( view )\ntap:addEventListener( tap.EVENT, gestureEvent_handler )\n```\n\n\n### Stacking gestures\n\n\nGestures can also be \"stacked\" on a view to watch for more than one gesture.\n\n_Note: This snippet is from the example `gesture-multigesture-basic`_\n\n```lua\nview = display.newRect( H_CENTER, V_CENTER+40, V_CENTER, V_CENTER )\nview:setFillColor( 0.3,0.3,0.3 )\n\n-- create some gestures, link to touch area\n\n-- pan gestures\n\npan = Gesture.newPanGesture( view, { touches=1, id=\"1 pan\" } )\npan:addEventListener( pan.EVENT, gestureEvent_handler  )\n\npan = Gesture.newPanGesture( view, { touches=2, id=\"2 pan\" } )\npan:addEventListener( pan.EVENT, gestureEvent_handler )\n\npan = Gesture.newPanGesture( view, { touches=3, id=\"3 pan\" } )\npan:addEventListener( pan.EVENT, gestureEvent_handler )\n\n-- tap gestures\n\ntap = Gesture.newTapGesture( view, { id=\"1 tch 1 tap\" }  )\ntap:addEventListener( tap.EVENT, gestureEvent_handler )\n\ntap = Gesture.newTapGesture( view, { touches=2, taps=2, id=\"2 tch 2 tap\" } )\ntap:addEventListener( tap.EVENT, gestureEvent_handler )\n\ntap = Gesture.newTapGesture( view, { touches=3, taps=1, id=\"3 tch 1 tap\" } )\ntap:addEventListener( tap.EVENT, gestureEvent_handler )\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmccuskey%2Fdmc-gestures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmccuskey%2Fdmc-gestures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmccuskey%2Fdmc-gestures/lists"}