Haptic Feedback Extension

frostypop

  • Posts: 76
Is it possible to create a haptic feedback extension (for iPhones / iOS) and is anyone interested in doing it?

Cheers.

mdotedot

  • Posts: 1654
Maybe I might investigate further when I have some more time, but the search below brought me to various places that someone might use to get started:

Standard Stencyl Vibrate: http://www.stencyl.com/help/view/mobile-features/

IOS

ios 10:
https://www.hackingwithswift.com/example-code/uikit/how-to-generate-haptic-feedback-with-uifeedbackgenerator?utm_campaign=This%2BWeek%2Bin%2BSwift&utm_medium=email&utm_source=This_Week_in_Swift_101
https://developer.apple.com/reference/uikit/uifeedbackgenerator (iPhone 7 / 7+ )

ios 9:
https://unifiedsense.com/development/using-taptic-engine-on-ios.html

import AudioToolbox
AudioServicesPlaySystemSound(1519) // Actuate `Peek` feedback (weak boom)
AudioServicesPlaySystemSound(1520) // Actuate `Pop` feedback (strong boom)
AudioServicesPlaySystemSound(1521) // Actuate `Nope` feedback (series of three weak booms)


Android (Try standard Vibrate from Stencyl first )

import android.os.Vibrator;
 ...
 Vibrator v = (Vibrator) this.context.getSystemService(Context.VIBRATOR_SERVICE);
 // Vibrate for 500 milliseconds
 v.vibrate(500);
 //And/Or:
   final long[] pattern = { 0, 200, 500, 500, 200 };
   v.vibrate(pattern , 0);
Note:

Don't forget to include permission in AndroidManifest.xml file:
<uses-permission android:name="android.permission.VIBRATE"/>


Javascript/HTML5:
http://diagramcenter.org/adding-haptic-feedback-to-html.html


Hope this is of help to someone.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

frostypop

  • Posts: 76
Thanks, with one minor caveat, I am not a coder. ;)

I did look into the Stencyl vibrate option but the sensation is quite different than the haptic feedback. Apple is keen on featuring its technologies in games and applications so I when using Stencyl, I am always trying to find ways to expound on its current feature list (I believe this may also bring more iOS devs into the mix as well).

An extension to allow for easy in game translation would also be of immense service.

Many thanks for the time to respond to my query.

Cheers!

gkhanni

  • Posts: 252
+1 here. Haptic is serious necessity for IOS games nowadays.