Is there a way to move an object about its axis to the direction of touch ?Suppose when I click on left the object should move to left about its axis or when I click on right side it should move to right side about its axis.
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
move on touch event
Yes there is. You touch function would have to take into account the touches location relative to the object and change the rotation based on that. Its actually really simple:x = touch.x - obj.x, y = touch.y - obj.y , find degrees using artan2 and adjust rotation accordingly. You might have to add or subtract some degrees in order to get the correct rotation.
views:1370 update:2011/12/29 9:44:01
热门文章
GameCenter LeaderBoards and Achievements Enabled Through OpenFeint
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
相关文章
Who's in the UK?
Launch game from hyperlink in email
Managing application switching? (iOS)
NEW: Pause/Resume Timers and a Table to Hold ALL Active Timers!
Securing in-app purchases
How to deal with indefinite numbers?
Cleanup problem with director -- help please!
quick syntax question
"INSTALL_FAILED_MISSING_SHARED_LIBRARY
interested in Corona SDK but concerned about API - is it possible to add features?
Launch game from hyperlink in email
Managing application switching? (iOS)
NEW: Pause/Resume Timers and a Table to Hold ALL Active Timers!
Securing in-app purchases
How to deal with indefinite numbers?
Cleanup problem with director -- help please!
quick syntax question
"INSTALL_FAILED_MISSING_SHARED_LIBRARY
interested in Corona SDK but concerned about API - is it possible to add features?
corona forums © 2003-2011