You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-30 16:26:50 +00:00
Merge pull request #78132 from bruvzg/ios_rt_orient
[iOS] Fix orientation change in runtime.
This commit is contained in:
@@ -961,6 +961,7 @@
|
|||||||
<param index="1" name="screen" type="int" default="-1" />
|
<param index="1" name="screen" type="int" default="-1" />
|
||||||
<description>
|
<description>
|
||||||
Sets the [param screen]'s [param orientation]. See also [method screen_get_orientation].
|
Sets the [param screen]'s [param orientation]. See also [method screen_get_orientation].
|
||||||
|
[b]Note:[/b] On iOS, this method has no effect if [member ProjectSettings.display/window/handheld/orientation] is not set to [constant SCREEN_SENSOR].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="set_icon">
|
<method name="set_icon">
|
||||||
|
|||||||
@@ -568,6 +568,11 @@ float DisplayServerIOS::screen_get_max_scale() const {
|
|||||||
|
|
||||||
void DisplayServerIOS::screen_set_orientation(DisplayServer::ScreenOrientation p_orientation, int p_screen) {
|
void DisplayServerIOS::screen_set_orientation(DisplayServer::ScreenOrientation p_orientation, int p_screen) {
|
||||||
screen_orientation = p_orientation;
|
screen_orientation = p_orientation;
|
||||||
|
if (@available(iOS 16.0, *)) {
|
||||||
|
[AppDelegate.viewController setNeedsUpdateOfSupportedInterfaceOrientations];
|
||||||
|
} else {
|
||||||
|
[UIViewController attemptRotationToDeviceOrientation];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayServer::ScreenOrientation DisplayServerIOS::screen_get_orientation(int p_screen) const {
|
DisplayServer::ScreenOrientation DisplayServerIOS::screen_get_orientation(int p_screen) const {
|
||||||
|
|||||||
Reference in New Issue
Block a user