|Topic was automatically imported from the old Question2Answer platform.
I build a landscape 2d game. The notch of the iPhones covers up a part of the game on the right or left. This part is important to the game. Therefore I don’t want the notch to cut into the game. Instead the notch part of the phone should be completely black. Can anyone help my with this?
Project Settings > Rendering > Environment > Default Clear Color to Black
Project Settings > Display > Window > Handheld > Orientation to SensorLandscape
In order to view your project
a ViewportContainer node as your scene root
a Viewport node as a child of ViewportContainer
all your main game scene contents as a child/children of Viewport
rect_position.x to the edge of the notch (you may have to do some Goldilocks work)
rect_position.x from Viewport’s
P.S. All of the above can be achieved in code using the root viewport and encapsulating it with an
if OS.get_name() == "IOS": or
if OS.get_model_name() in [list of notch carring phone models]