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
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
How do we "draw a square" on detected faces on camera preview feed in Flutter? Is there a cross platform solution to this?
Flutter provides a Camera Plugin, but is there a way for us to draw a square box detecting faces on the preview feed? Any thoughts on this please?
.
SOMETHING LIKE THIS EXAMPLE CAMERA PREVIEW FEED
Firstly, get the image data. This can be done by either using the camera plugin's output, or even directly communicate with the SurfaceView/TextureView.
Secondly, run face detection algorithm. If you do not need cross-platform, https://medium.flutterdevs.com/face-detection-in-flutter-2af14455b90d?gi=f5ead7c6d7c9 MLKit sounds good. If needing cross-platform, you can use Rust algorithms like https://github.com/atomashpolskiy/rustface and bind Rust code to Flutter via https://github.com/fzyzcjy/flutter_rust_bridge. Or, use C++ face detection algorithms and bind to Flutter (though setup may be a bit harder).
Lastly, once you know the face, draw a box around it. For example, Container widget.
Currently I'm using this library:
https://pub.dev/packages/camera and it has setFocusMode to either Auto or locked, but I need a way to be able to get manual focus mode for camera, where user can tap in camera feed and the focus should be adjusted accordingly.
How do I go about implementing this in my app?
I found this plugin https://pub.dev/documentation/manual_camera/latest/. Does this work? you could use focus distance. If you could get the distance of the object you could set it that way. It's almost like shooting out a ray in game programming. I don't know if this is possible to do but maybe using the size of the objects in the image you could get the distance. someone else has probably already figured this out.
I am using the camera for reading some text and currently, my images look quite blurry
Is it possible to change the focus of the camera?
I am using
https://www.raspberrypi.org/products/camera-module-v2/
Yes, it's definitely possible, I did it many times. Sometimes in the camera box there is even a specific tool to rotate the lens included (check if you have it, I experienced that it's not always present). If you don't have a tool take thin pliers and rotate the lens, you can look here.
I am building a virtual mouse kind of app, so is there any way in flutter by which I can move the mouse pointer to a specific coordinate on the screen.
I know there is a Robot class in java which can do the exact thing, so is there something similar in Flutter(Dart)
Note: I am not referring to the MouseRegion Widget kind of stuff
There is no such functionality built into Flutter, but you could write a plugin that would do that.
Does anyone know if there are any pre-made packages for effects like the ones in iMessage?
https://www.youtube.com/watch?v=gfAPip-QtTc
I'm specifically looking for something along the lines of the confetti or balloon effect (but with hearts)
If there are no pre-made package, what would be the best way to go about making something like this (as an overlay). Would it be easy to do natively or use something like Rive (https://rive.app/)
Thanks!