#text leaking out of the popup

1 messages · Page 1 of 1 (latest)

sharp salmon
#

Hey everyone, so, unfortunately for me, I still wasn't able to fix the issue of text "leaking" out of the popup. Due to the fact that I'm struggling with this problem for couple of days by now, I think that making a thread so that my issue doesn't get mixed up with other UI related questions. So, this is how the thing currently looks like:

#

I literally wrote the introduction to my problem and discord decided "eh, screw this guy". Well, I guess I will just describe it once more

#

This is how my popup currently looks like:

#

As you can see, the text is clearly leaking out of the popup.

#

The structure of the popup in question:

#

Any kind of help would be appreciated ❤️

wintry portal
#

Showing just the hierarchy isn't very useful

#

What components are on those things

#

This is the way to do it. Probably doesn't work because you've missed something

sharp salmon
#

back

#

hmmm, well, I just tried it out again and well

#

@wintry portal

stuck girder
#

It is workong

#

You'd need to add padding

wintry portal
#

When working with UI, press T and use the UI tools

#

You need to sort out the layout/alignment properly now. On the 'destroy' put a LayoutElement component and tick the ignore flag .. this will allow you to have it under the vert layout group and put it wherever you want

sharp salmon
#

still no

#

there shouldn't be anything on the tag object, right?

wintry portal
#

Tick 'Control Child Size' height on the vert layout group

sharp salmon
#

ok, it works now, one more thing

#

how do I keep the text inside?

sharp salmon
#

@wintry portal (I hope you don't mind being pingged)

wintry portal
#

You need to look at the settings, the anchors, the padding

#

In your screenshots, you snip off all the info that is useful

sharp salmon
#

Sorry I didn't answer, was at school

#

here

#

I mean, tbh on the text object there is nothing attached

#

here's the popup image though

wintry portal
#

🤦‍♂️

#

cutting off info again

#

the recttransform matters...

sharp salmon
#

only so much I can screenshot in one piece

wintry portal
#

UI scale should ALWAYS be at 1,1,1

#

weird thigns start happening when you don't do that

#

you also don't have it anchored to any specific part of the canvas

sharp salmon
#

let's just say it's a way too big at 1,1,1

wintry portal
#

Is it worldspace UI?

#

I see it is from one of your earlier screenshots

#

ALL UI elements should be at 1,1,1

#

the parent can be what you resize to make it accurate

#

I normally have an empty gameobject, and set the scale to 0.02 on that

sharp salmon
#

it is worldspace UI, yes

sharp salmon
#

Like

wintry portal
#

for the popup, probably the center will do

sharp salmon
#

I assume like this?

#

oh right

#

popup

#

not text

wintry portal
#

I don't know what you're sharing..

#

you sent a screenshot of the popup layout element + image.. then a rect transform without saying anything...

sharp salmon
wintry portal
#

nice

#

I find it strange that the text is outside of the recttransform

#

But anyway.. set these values to what looks right

sharp salmon
#

fixed, but another issue now, ugh

#

even though destroy has ignore layout

wintry portal
#

ok, so set it's anchor to be bottom right..?

sharp salmon
#

ok and now text is being messed uup again

#

it changes it's position depending on the popups position in the worldspace\

wintry portal
#

without a screenshot it doesnt make sense

sharp salmon
#

I was making one

wintry portal
#

however, I noticed.. Z should be 0

#

for all child elements of the canvas, Z should be 0

wintry portal
# sharp salmon

just toggle the popup gameobject off/on and see if anything changes

sharp salmon
#

AFK

wintry portal
#

yeah, because you have set them to not 0

sharp salmon
#

ah the code changed the Z

#

alright, I will continue later, gotta do homework

sharp salmon
#

just in time before 24 hour mark

#

well, the issue was still not resolved

#

@wintry portal another problem

#
            var Rect = image.GetComponent<RectTransform>();
            image.SetActive(true);
            Rect.position = new Vector3(objectHit.position.x, col.bounds.max.y + 1.5f, 0);```
#

still doesn't work

wintry portal
#

"doesn't work" isn't a descriptive problem. Explain better

sharp salmon
#

Z still gets changed

#

even though it's 0

wintry portal
sharp salmon
#

something weird is happening

sharp salmon
#

so yeah

wintry portal
#

I would answer quicker if I didn't have to ask for stuff all the time

#

you've got that issue, it's obviously something code related... where's the code?

sharp salmon
#

ok I got it bigger, had to scale it up, it just doesn't move

#

well it does

#

but slightly

#

barely noticable

#
            InteractionRadius fetchData = objectHit.GetComponent<InteractionRadius>();
            var col = objectHit.GetComponent<BoxCollider>();
            var Rect = image.GetComponent<RectTransform>();
            image.SetActive(true);
            Rect.anchoredPosition = new Vector3(objectHit.position.x, col.bounds.max.y + 1.5f, 0);```
wintry portal
#

I think perhaps I've misunderstood what you were doing with this

#

what's image ? I assumed it was Image image .. but is it the popupParent GameObject?

sharp salmon
#

no it is not, it's an image

sharp salmon
#

so uh, @wintry portal ?

sharp salmon
#

well