hey guys,
i watched a video on dragging physics, and they are using the dragme sample. now those are custom made rectangles and i can’t figure out how to get the drag physics added to my code. can i get some help from anyone please? the part i want to become draggable is the part that says local cursor:
[code]
module(…, package.seeall)
local localGroup
function new()
localGroup = display.newGroup()
print( “Level 1” )
local sky = display.newImage( “Turqouise Back.png”, 0, 0 )
localGroup:insert(sky)
local button = display.newImage( “Main Menu.png” )
local function buttont ( event )
media.playEventSound( “Robot Blip.caf” )
if event.phase == “ended” then
director:changeScene(“Menu”,“moveFromLeft”)
end
end
button:addEventListener(“touch”,buttont)
button.x = 260
button.y = 34
localGroup:insert(buttonlocal cursor = display.newImage( “triangle.png”, 120, 450 )
localGroup:insert(cursor)
[code]
[import]uid: 19836 topic_id: 7513 reply_id: 307513[/import]
sorry i kinda messed up with the code on the bottom…this is what it should look like
[code]
module(…, package.seeall)
local localGroup
function new()
localGroup = display.newGroup()
print( “Level 1” )
local sky = display.newImage( “Turqouise Back.png”, 0, 0 )
localGroup:insert(sky)
local button = display.newImage( “Main Menu.png” )
local function buttont ( event )
media.playEventSound( “Robot Blip.caf” )
if event.phase == “ended” then
director:changeScene(“Menu”,“moveFromLeft”)
end
end
button:addEventListener(“touch”,buttont)
button.x = 260
button.y = 34
localGroup:insert(button)
local cursor = display.newImage( “triangle.png”, 120, 450 )
localGroup:insert(cursor)
[code] [import]uid: 19836 topic_id: 7513 reply_id: 26604[/import]
anyone please? is there a different method to this? [import]uid: 19836 topic_id: 7513 reply_id: 26642[/import]
i added the code to start the physics engine but still can’t figure out drag. [import]uid: 19836 topic_id: 7513 reply_id: 26797[/import]
please anything? [import]uid: 19836 topic_id: 7513 reply_id: 27878[/import]
Check This Out: http://developer.anscamobile.com/forum/2011/02/04/corona-crashing-when-i-try-drag-object-using-dragbody
The sample you will see there is a basic drag sample if you want something
more (real) it will need a bit more work but hope this gets you started! [import]uid: 30314 topic_id: 7513 reply_id: 27899[/import]
thanks i got it. [import]uid: 19836 topic_id: 7513 reply_id: 27968[/import]