3D touch on IOS

Hi, 
 
Its mentioned in the API docs to use event.pressure but I am getting the value less than 0.4 when deploying in device.

Can u specify the way to implement 3d Touch for IOS?

[lua]

function onButtonTouch( event)

– body

if ( event.phase == “began” ) then

    if(event.pressure ~= nil) then 

      print(event.pressure)

      onScreenMessage.textObject.text =  event.pressure

    else

      print(event.pressure)

      onScreenMessage.textObject.text = "Touch event began on: " …event.name… event.target.id

     end

elseif ( event.phase == “ended” ) then

    onScreenMessage.textObject.text = "Touch event ended on: " … event.target.id

end

    return true

end

[/lua]

Are you checking for “Moved” events?

Rob

Even I tried that. I am not able to get the pressure value all the time.

Hi @pradeep4,

Can you give a brief list of the values you’re getting as you “3D touch” on the device? For example, a list of about 10-20 values as you begin and end the 3D touch. I’d just like to see what the range is.

Thanks,

Brent

I don’t have a 3D touch enabled device yet but would love to incorporate event.pressure in a game I’m working on…  I have a realistic default outcome which relies on the user double tapping, but I’d like to detect if event.pressure ~= nil and then override the double tap if the user’s on a 6S device.

Question I have is what would the minimum even.pressure reading for a tap about twice the pressure as a normal tap?   2.0?  3.0?  I don’t have any way of testing this, but technically I can code it in to work if I know what that pressure reading would be?

Thanks,

Nate

Hi Nate,

While I (or another developer) could potentially test some values on our iPhone 6Ss, and report them, the concept of a 3D touch is somewhat subjective. What one user considers enough pressure to trigger it, another may consider not enough pressure. As the documentation states, 2.0 is basically “twice the amount of normal pressure” and 3.0 is “three times”. You can try using that as a basic guage on what is considered a 3D touch inside your Corona app. Beyond that, I’m not sure what advice I can offer. :confused:

Take care,

Brent

Hey Brent, that sounds good - appreciate your feedback.  I’ll probably post something to the forums soon for private TestFlight invites to this new game.  Would love to just be able to test out the game on a few force-touch enabled devices to make sure before I submit the game it’s running well for them.  As a start I’ll probably use event.pressure >= 2.0…

Thanks,

Nate

Has anyone successfully implemented reading event.pressure?  If so, would you be able to post some brief code of your touch event listener?  Thanks!

Nate

Some of our DragMe and Multitouch samples have event.pressure recognition: https://github.com/coronalabs/samples-coronasdk/blob/master/Interface/DragMeMultitouch/main.lua

Thanks Michael!

Hi guys,

Can use event.pressure within the application without any problem, my question is: can not use the “3D touch” from the application icon? (Non-enterprise)

Forcy-tweak-iOS-9.jpg

Thanks,

Juan

Hi @xdookie,

At this time, we don’t offer “app icon” 3D Touch through Corona SDK (it would need to be done with Enterprise). We’ll look into enhancing the 3D Touch functionality in the future and possibly exposing this functionality to the SDK-built app.

Best regards,

Brent

Are you checking for “Moved” events?

Rob

Even I tried that. I am not able to get the pressure value all the time.

Hi @pradeep4,

Can you give a brief list of the values you’re getting as you “3D touch” on the device? For example, a list of about 10-20 values as you begin and end the 3D touch. I’d just like to see what the range is.

Thanks,

Brent

I don’t have a 3D touch enabled device yet but would love to incorporate event.pressure in a game I’m working on…  I have a realistic default outcome which relies on the user double tapping, but I’d like to detect if event.pressure ~= nil and then override the double tap if the user’s on a 6S device.

Question I have is what would the minimum even.pressure reading for a tap about twice the pressure as a normal tap?   2.0?  3.0?  I don’t have any way of testing this, but technically I can code it in to work if I know what that pressure reading would be?

Thanks,

Nate

Hi Nate,

While I (or another developer) could potentially test some values on our iPhone 6Ss, and report them, the concept of a 3D touch is somewhat subjective. What one user considers enough pressure to trigger it, another may consider not enough pressure. As the documentation states, 2.0 is basically “twice the amount of normal pressure” and 3.0 is “three times”. You can try using that as a basic guage on what is considered a 3D touch inside your Corona app. Beyond that, I’m not sure what advice I can offer. :confused:

Take care,

Brent

Hey Brent, that sounds good - appreciate your feedback.  I’ll probably post something to the forums soon for private TestFlight invites to this new game.  Would love to just be able to test out the game on a few force-touch enabled devices to make sure before I submit the game it’s running well for them.  As a start I’ll probably use event.pressure >= 2.0…

Thanks,

Nate

Has anyone successfully implemented reading event.pressure?  If so, would you be able to post some brief code of your touch event listener?  Thanks!

Nate

Some of our DragMe and Multitouch samples have event.pressure recognition: https://github.com/coronalabs/samples-coronasdk/blob/master/Interface/DragMeMultitouch/main.lua