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:1369 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
相关文章
Reset Game (solved)
Ending a scene
Looking for an Experienced Programmer To Work With Me And My Team!
Rotate physics with map/object *issue* (plug and play code included)
Distribution with Ad Hoc doesn't work
Clip or Crop Images
Are highscores important in a puzzle game?
[iOS] Walkthrough - Testing On Device
Debug windows doesn't show on Mac
My first app available on the App Store
Ending a scene
Looking for an Experienced Programmer To Work With Me And My Team!
Rotate physics with map/object *issue* (plug and play code included)
Distribution with Ad Hoc doesn't work
Clip or Crop Images
Are highscores important in a puzzle game?
[iOS] Walkthrough - Testing On Device
Debug windows doesn't show on Mac
My first app available on the App Store
corona forums © 2003-2011