Page 1 of 1
KeepRectTransformOnScreen
Posted: Wed May 04, 2022 11:05 am
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.
I put the script on the main panel. Am I using it wrong?
Thx in advance
Re: KeepRectTransformOnScreen
Posted: Wed May 04, 2022 1:07 pm
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.
Re: KeepRectTransformOnScreen
Posted: Wed May 04, 2022 3:13 pm
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?
Re: KeepRectTransformOnScreen
Posted: Wed May 04, 2022 3:19 pm
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.
Re: KeepRectTransformOnScreen
Posted: Wed May 04, 2022 3:34 pm
by F1foux
Great, I'm going to use it for that then
Thx again Tony!
Re: KeepRectTransformOnScreen
Posted: Wed May 04, 2022 3:37 pm
by Tony Li
Glad to help!