I’ve used a Horizontal Box with Spacers thinking it would resize properly but has an error where the image resizes from the corner even though it’s alignment is center/center. …
Any Tutorials on this sort of thing?
I’ve used a Horizontal Box with Spacers thinking it would resize properly but has an error where the image resizes from the corner even though it’s alignment is center/center. …
Any Tutorials on this sort of thing?
Without the container, or some other container; does an image size from the center? Perhaps the default way an image is sizing is from the top left side and it can’t be changed?
In any case, you can use padding on the images instead of spacers. Just a personal thing I tend to use… it makes the hierarchy tab less cluttered.
Agreed with the bit about spacers above. Padding would work nicer and give you more control (and less clutter!). When it comes to the image resizing from the corner, I don’t think that’s what is happening, seem to work fine:
To me it seems you Size To Content
but I might be missing the point. What is the ideal end result like?
Sorry I left a part out, the resizing is done in Graph. The goal was just to enlarge an Image on Hover, maybe even an anim.
Sorry I left a part out, the resizing is done in Graph. The goal was just to enlarge an Image on Hover, maybe even an anim.
You then want to turn those images into user widgets asap. Images have no OnMouseEnter / Leave. Unless they do in UE5, that is.
The size itself can be done in a dozen ways, animated or otherwise. But before you go further with this, you’d need to figure one thing out. Will the highlighted, enlarged element overlap its neighbours?
What if #2 gets so large that it gets on top of #1 & #3. That’s the crux. The horizontal box you’re jamming it all in has no idea what custom zOrder
is:
Also, a Wrap Box is an underrated container - it’s a smart horizontal / vertical box:
Its slots sport a special type of padding - shared by all children. The WB also plays pretty well with Desired Size.
When I create an Anim using Scale it does fine but is there any way to push out the non hovered slots?
The horizontal box does not know you’re scaling things. You’d need to adjust the padding. Or the desired size of the image but that’s a bit more tricky.
Sorry … what about the Wrap Box?
You were trying to separate elements of the Horizontal Box with spacers. Wrap Box does it automatically.
The resizing is done by an Anim using Scale, it doesn’t seem to affect anything other than the Button or Image.
As above, scaling will not push surrounding elements around. The HB does not register scale as a change in Desired Size. No widget does.
If you want to use scale for this, you’ll need to push surrounding elements around manually which is convoluted.
For a mouse over enlargement, have a user widget with a size box and image. Animate the size box’ width and height overrides. This way you could use a HB and it will push neighbours around.
Alternatively, animate slot padding while you animate scale if you must use scale for this. A bit janky but could work. You’ll need to massage the values.
This, right? Once you work in an animation, it will be less jarring. This uses a size box described above. Each element is a separate user widget.
That’s perfect thanks for the help.
how to let the cell size self fit , there is any way to control the cell size in C++ code ,if there are several controls in one cell ,we must ensture the cellheight or cellwidth is max value of chirldren in cell ,so how to control it ?