New line touch event

Hi all,
I am trying to achieve a new line touch event, and when I look at the documentation it says
Currently display.newLine objects do not support touch events (case #3803)

is there a place I can go to find this case? and to see if it has been resolved? The only way I can find is to go through each daily build and search for it…

also is there any other way to achieve a newline touch method if this case has not been solved? I am trying to achieve a spider being able to throw webs at the celling… and the new line method is perfect for a web line
any pointers would be greatly appreciated

Thanks

Vik [import]uid: 67619 topic_id: 19333 reply_id: 319333[/import]

I am using build 704 [import]uid: 67619 topic_id: 19333 reply_id: 74579[/import]

Depending on the effect a thin newRect might be an option? [import]uid: 52491 topic_id: 19333 reply_id: 74628[/import]

Peach,

I thought abt this, but the issue is the rect is always straight, only lets me set the start points (top and left), does not let me set the end points
[import]uid: 67619 topic_id: 19333 reply_id: 74634[/import]

Rotation might be a possible option? Else I’d suggest posting in feature request.

Peach :slight_smile: [import]uid: 52491 topic_id: 19333 reply_id: 74651[/import]

hey peach,

I managed to get the newrect to work the way I wanted to… but the physics has gone completely wrong as I am moving the objectreference from center to top… any thoughts?

[code]

local physics = require “physics”
physics.start( true )
physics.setDrawMode(“normal”) – set to “debug” or “hybrid” to see collision boundaries
physics.setDrawMode(“hybrid”)
physics.setGravity( 0, 9.8 ) --> 0, 9.8 = Earth-like gravity

local cel = display.newRect(0, 0, display.contentWidth, 100)
physics.addBody(cel, “static” )

local line = display.newRect(200, 100, 10, 600)
local square = display.newRect(line.x - 50 , line.y+200 , 100, 100)

function movement(event)

line:applyLinearImpulse( 1, 0, line.x, line.y )

end

physics.addBody(line, “dynamic”, {shape=unit} )
physics.addBody(square, “dynamic” )
line:setReferencePoint( display.TopCenterReferencePoint )

local joint = physics.newJoint( “pivot”, cel, line, line.x, line.y - 20 )
local joint1 = physics.newJoint( “weld”, square, line, 200, 600 )

Runtime:addEventListener( “touch”, movement )

[/code] [import]uid: 67619 topic_id: 19333 reply_id: 75016[/import]

What kind of effect are you actually trying to achieve here? (Sorry, just want to be sure before I start prodding at the code ;))

Peach :slight_smile: [import]uid: 52491 topic_id: 19333 reply_id: 75037[/import]

Peach,

Basically I need to have three bodies,

  1. Celling (static)
  2. long thin rectangle (dynamic)
  3. Square (dynamic)
    The rectangle is attached to the celling, so that it can swing backwards and forwards. The square needs to be attached to the bottom of the rectangle.

The issue I am facing is when the rectangle swings, the square moves differently to the rectangle. I need both of them to move together. ie the square should be fixed to the rectangle at the bottom, so if I apply any impulse both of them should move together…

hope that makes sense

thanks again [import]uid: 67619 topic_id: 19333 reply_id: 75074[/import]

It sounds as though you may be better off using a complex body - see here; http://developer.anscamobile.com/content/game-edition-physics-joints#Weld_joint

Could that work for the effect you’re after? It sounds like it but you know better than I do what you are going for :slight_smile:

Peach [import]uid: 52491 topic_id: 19333 reply_id: 75213[/import]

Peach,

from my understanding a complex body is still one image, with multiple shapes designed into it…

what I am trying to do is something like a spider, who throws a web at the celing, swings back wards or forwards to get momentum, then cuts the web and the spider is flung either forwards or backwards… (this works with the newline - but no touch event)

I am trying to replicate the same thing using the newrect (so that I can put my own image in as well)

If i use one image then I would need to separate the two images, transfer the momentum into my spider image etc… Iam sure it can be done… I just thought this would be wayy to much work as opposed to just using two images…

If i can do the same thing with the newLIne, it should work with newrect yeah?

or am i trying to make this more complex than it should…

all i want is my spider to be able to shoot a web to the celling, climb up, swing on the web, and then let go of the web…

Vik

[import]uid: 67619 topic_id: 19333 reply_id: 75244[/import]

The problem is weld joints will move a bit in certain situations. You could consider constraining the spider manually, as in setting its X and Y during the swings, perhaps.

If I have the time I’ll try to have a bit more of a play with it but can’t make any promises - it’s just over 2 days to Christmas here in Oz, after all :wink: [import]uid: 52491 topic_id: 19333 reply_id: 75256[/import]

thanks Peach… any help would be appreciated…

where in Oz are you? same here, I am from melbourne [import]uid: 67619 topic_id: 19333 reply_id: 75258[/import]

I have not yet had a chance (Christmas madness and all that) to take more of a look but am hoping for some chill time later.

I’m in Sydney, however I grew up in Adelaide and then lived in Melbourne for almost 2 years before coming here.

I hope your weather is nicer than Adelaide for Christmas - I hear it’s going to be up to 36 there. (Sydney is looking to be a cool top of 25!)

Peach :slight_smile: [import]uid: 52491 topic_id: 19333 reply_id: 75412[/import]

hey peach,

any update on the above?

Thanks

Vik [import]uid: 67619 topic_id: 19333 reply_id: 78425[/import]

Hey Vik,

I got to take a little look but did not make any progress; unfortunately my free time is very limited.

It may be worth making a new post about this as you’ve moved away from the original issue a bit and someone else might have some insight?

If I find myself with more free time I’ll certainly take another look, too.

Peach :slight_smile: [import]uid: 52491 topic_id: 19333 reply_id: 78450[/import]