Download

Rendering Sprites in UMG

Hi guys,

I’m trying to render sprites in UMG for a PC/Console game. I don’t need flipbook animation (Epic staff answered someone else’s question a while back saying flipbooks in UMG aren’t possible) but I’m wondering if I can somehow display individual sprites through UMG.

My reasoning is that instead of having 50 individual png files for each UI element in my interface, I’d rather have a texture atlas that I can just reference via each element’s width, height and point of origin on the png. Rather than manually measure and align each element and grab that information (it’s tedius), I threw all the UI elements into TexturePacker and exported for UE4, which spits out a .paper2dsprites file with all the necessary information. When you import this file into UE4, it automatically separates each element on the atlas into sprites. It’s an awesome process up until this point, because I have no idea how to use those sprites with UMG, if at all.

Any thoughts? Do you guys know of any other processes outside of manual input for assigning each element’s width/height/origin?

We don’t support atlasing in UMG right now, though we do batch on texture and material. Keep your textures in separate files, the plan is to generate the atlas we need automatically at cook, or at run-time like slate does with raw PNGs. The plan is up in the air, but the goal is to make it magically better without making the user create atlases manually.

Sounds wonderful to me - thanks for making this plain. Any rough ideas on a roadmap for something similar to your idea being implemented?

Not sure, right now the perf focus is on CPU usage of Slate’s layout logic.

So, is there some kind of automated texture packing planned for widgets lets say in this year?

Now,we can apply sprite in UMG,but when I change the material of sprite,it dosen’t work,does anyone else have this problem?:rolleyes: