KeepRectTransformOnScreen

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
F1foux
Posts: 26
Joined: Mon Jul 19, 2021 1:21 pm

KeepRectTransformOnScreen

Post by F1foux »

Hi Tony,

I wanted to use your script "KeepRectTransformOnScreen" to keep my overhead speech bubbles I created using your Bubble UI subtitle template. But for some reason it seems to do exactly the oposite, it moves the Transform offscreen like in the screenshot.

Image

I put the script on the main panel. Am I using it wrong?

Thx in advance
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: KeepRectTransformOnScreen

Post by Tony Li »

Hi,

Please try this version:

PixelCrushers_KeepOnscreenPatch_2022-05-04.unitypackage

If you're using screen space bubbles, use the UI Smooth Follow example on the Dialogue System Extras page.
F1foux
Posts: 26
Joined: Mon Jul 19, 2021 1:21 pm

Re: KeepRectTransformOnScreen

Post by F1foux »

Thx Tony. Now it's working, but parts of the Bubble still go over the screen border when keeping it in frame. Is there like a threshold I could set or what does the script reference, the border of the rect transform?
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: KeepRectTransformOnScreen

Post by Tony Li »

Hi,

KeepRectTransformOnScreen keeps the center point of the UI onscreen, which helps alert the player that the speaker is probably offscreen on that side of the screen. If you need to keep the entire UI onscreen, you'll need to either modify the script or use a different one.
F1foux
Posts: 26
Joined: Mon Jul 19, 2021 1:21 pm

Re: KeepRectTransformOnScreen

Post by F1foux »

Great, I'm going to use it for that then :)

Thx again Tony!
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: KeepRectTransformOnScreen

Post by Tony Li »

Glad to help!
Post Reply