I am having trouble with how to change and keep screen oreintation on mobile
You should test this in a release build to see if it works right. The debug builds may not.
What kind of problem are you having?
I cannot figure out how to make my game work on all screen sizes, or make sure the orientation always shows up as landscape
I did and it does not
Open game.project. Set the width and height to something reasonable for a landscape game. Perhaps 1136x640. Make sure that Dynamic Orientation setting of game.project isn’t checked.
Here you need to change your render script. You’ve probably noticed that the graphics get stretched when the aspect ratio changes. This is the default behaviour of the render script in Defold. Sometimes it’s ok to stretch the game, but most times you want to maintain aspect ratio and perhaps show more of the game area. This can be changed through the use of a custom render script or through the use of extensions such as RenderCam or Defold-Orthographic.
I think that can be changed in the android manifest.xml
android:screenOrientation="landscape"
or one of these............
android:screenOrientation=["unspecified" | "behind" |
"landscape" | "portrait" |
"reverseLandscape" | "reversePortrait" |
"sensorLandscape" | "sensorPortrait" |
"userLandscape" | "userPortrait" |
"sensor" | "fullSensor" | "nosensor" |
"user" | "fullUser" | "locked"]
You shouldn’t have to mess with the Android manifest file to solve this. Besides, that would be a solution for Android only and that defeats the point of using a cross platform engine such as Defold. I believe my answer above solves the problem from the original question.