Home > database >  Detect device orientation in flame (flutter package)
Detect device orientation in flame (flutter package)

Time:01-28

I've been following the doodle dash tutorial for flame in flutter:
https://codelabs.developers.google.com/codelabs/flutter-flame-game#0
I'd like to modify it so that the user can tip the phone left and right to move dash, rather than having on-screen buttons. However, I can't find anything in the docs which refers to an OrientationDetector or anything like it. Is there something here that I'm missing, or is this missing from flame? Thanks

CodePudding user response:

Flame does not provide this from within the engine, to act upon such events you should use an external package like for example sensors_plus or any of the other packages that provide you with gyroscope data.

  • Related