Letterbox / Pillarbox and Screen.width/height safe?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Letterbox / Pillarbox and Screen.width/height safe?

Post by VoodooDetective »

I was just about to implement letterboxing and realized it would make Screen.width, Screen.height inaccurate. I was just wondering if DS makes use of those methods, and if so, the recommended approach for handling letterboxing.

Here's the letterboxing script:
https://github.com/mlvhub/unity/blob/ma ... Utility.cs

That's sort of vaguely what I was planning to do.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Letterbox / Pillarbox and Screen.width/height safe?

Post by Tony Li »

Hi,

By default, the Dialogue System uses plain old Unity UI. It doesn't do anything special for letterboxing. Your script can adjust the canvas for letterboxing if you want.
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Re: Letterbox / Pillarbox and Screen.width/height safe?

Post by VoodooDetective »

Ah ok, great. Well one more question then, the canvas will lose the reference to your camera if you don't use Don't Destroy on Load on the camera. I was just wonder if you think it's best to use Don't Destroy on Load on the camera, or just have a script that updates the reference on scene change?
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Re: Letterbox / Pillarbox and Screen.width/height safe?

Post by VoodooDetective »

That's a silly question, I'll use a script.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Letterbox / Pillarbox and Screen.width/height safe?

Post by Tony Li »

Sounds good!
Post Reply