This is a texture for a dialogue/comment bubble.
i need to scale it sometimes because the comments sometimes are bigger.
When i’m scaling it so the comments fit in, it stretches the outline and looks ugly:
Is there a way around this?
Hey there @SophiaWolfie! Often this issue is common for UI elements where you want the edges to remain the same but the center to be able to be scaled without distortion. Generally you would use something known as 9-slicing to cut the UI element into 9 pieces and designate which dimensions can scale and which would need to remain the same.
However the utilities to make this are exclusively in the UI suite, and from the look of things you’re working with a 3D actor. I believe you can still use the UI 9 slice feature if you use a 3D UI widget instead of a plane.
Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.
Resources for 9 slicing (or 3 slicing) in UE4/5:
Thanks. That seems to be the solution.
So in theory all i have to do is to do something with this:
Basically create a square mask and make sure the edges are world aligned? Maybe not world aligned? There must be something that keeps the image in the material the same scale, right?
Interesting how the 3 slice can also be useful for many other cases like UI with patterns below text.
Hi, here’s a simple 9-slice material - it’s not perfect by any means, but may be useful as an example. Scale only works 1.0 or greater
Awesome. Thanks so much.
I have it here:
I noticed it doesnt work properly in ISM. I assume because the object Scale doesn’t work for ISM? Idk exactly if thats the issue.
I made some searches looking for how to get ISM instance scale. Found another post where you show a solution, but you use instancebounds and i dont have this node in UE4:
That should work with both ISMs and HISMs - just not with foliage. I wasn’t able to find a way to get the scale for foliage instances in 4.27.
In the HISM and ISM that is returning the scale of the whole mesh, not the specific instances meshes
I tried tweaking it around with what i saw from my searches.
And I made it work with the Custom UV with some trial and error:
However, the instance 0 always bugs, so I just scale it to 0, 0, 0 and dont use it.
Other than this the alternative is to use Per Instance Custom Data Value, and send in the scale to the material that way.
Oh, nice! I haven’t seen that approach before.
It looks the index 0 issue is from the rotation (Transforming to WorldSpace), rotate another index and it exhibits the same behavior.
You can fix that by changing the Transform going to the Debug Node to “Tangent Space->World Space” and add an “Abs” node:
Thanks this completely fixes it
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.