I am currently developing an Android game (in landscape orientation) using Gdevelop and while testing the game on the phone, I found out that when I rotate my phone on the other landscape side, the game orientation isn’t adjusting.
I try to use the Device sensors Extension, but I cannot find any action/logic regarding this problem.
Please help me guys. Thank you.
Device Sensor is probably what you’re going to need to use, with some combination of comparing the current sensor direction vs what is considered “normal”.
I haven’t ever messed with it, but you can use the orientation examples on examples page https://gdevelop-app.com/game-examples-starters/ as a good start.
Thanks for your reply, but the starter game example with Device Sensor Extension was only applied to an object. And I cannot find any action that corresponds to the whole game orientation.
I also can’t find any tutorial on how to implement this Device Sensors
The examples using it on a object is just an example of using the expression. The idea is to use the actual expression used in the examples, and then use the “Compare two numbers” condition.
That would let you compare the orientation against a number (think of rotations in a degree).
What I’d recommend doing is setting up a simple game which stores the expression in the example “DeviceSensors::OrientationAlpha()” to a text object every frame. That’ll let you know what each “Direction” is as a you rotate. Then, once you know what “upside down” is, you can simply use a “Compare 2 numbers” condition of like “DeviceSensors::OrientationAlpha() > 100” AND “DeviceSensors::OrientationAlpha() < 200”, with some events to flip your screen. As far as how to flip your screen, you’re probably going to need to use the reflection layer filter or something similar.
That said, I could be totally off.
Changing the camera angle would be purely visual, the hitboxes would remain on the original positions.
Not sure about layer effects, I assume they’re purely visual too.
I would recommend you rotate your phone to the working side
I guess this should go in Feature requests, but what is the need for this feature?
Thanks for the reply. I think this feature is for user efficiency, since almost all landscape games on smartphones have this kind of feature;
so I hope that it could also be implemented on gdevelop soon.
I just added it to the feature requests