One texture for multiple meshes.

Hi everyone !

Another question regarding textures.
I’m doing my level selection screen, And would like to have a mesh per level number (imagine having 01 02 03 04 05 and you select the one you want), I’m doing a mesh per level as I’m scaling up the selected number.

Right now I’m using a material per mesh, and a texture per material, I end up with 10 textures and 10 materials… that’s not cool.

Anyway, I want to use a texture that contains all the levels numbers, then attach it to one material, assign this material to all my meshes, and for each meshes, move my UVs to the right number (mesh 01, use only the location of 01 on the texture).

That’s my first step, if someone have the solution, I guess it’s something I have to use in the material editor, then in the blueprint construction of my mesh. Thanks for helping !

Many thanks !

.

Possible.

But within your material, you must use a panner and zoom to select the correct UV coordinates for each number tile.

The inputs to the panner must be made Material params (A Vector should be enough)

After that you can create mutltiple Material instances out of this material (1 for each number).Set the correct values for the panning params in these material instances. After that apply those to the meshes.

Kind of like a spritecard :wink:

I’m just looking into this for my HUD and the following example is what i’m looking into: UCanvas::MakeIcon

//get the uv location

KillsBg = UCanvas::MakeIcon(HUDMainTexture, 15, 16, 235, 62);
TimePlaceBg  = UCanvas::MakeIcon(HUDMainTexture, 262, 16, 255, 62);
PrimaryWeapBg = UCanvas::MakeIcon(HUDMainTexture, 543, 17, 441, 81);
SecondaryWeapBg = UCanvas::MakeIcon(HUDMainTexture, 676, 111, 293, 50);

//Draw the texture

Canvas->DrawIcon(KillsBg, KillsPosX, KillsPosY,	ScaleUI);

Maybe that can help.

If he does not need any mesh in there, he can simply use DrawText ndoe with a custom Font asset whcih will be a sprite atlas

Hi ,

Thanks for the quick replies, I appreciate :slight_smile:

Unfortunatly Devero I’m not coding at all (except some basic MEL scripting in maya for particles).

I like the idea of a custom font that I can use instead of textures, I could even use this to my text menu !

How can I proceed ?

Actually I discover material instances as mentionned by mindfane.
I’ll give a try with pan UV with vector param.

I’ll let you know if I succed :slight_smile:

Hi,

I finally get it to work using material instancer, texture parameter and vector parameter. I still have one texture per number, but I have only one material, so I’m pretty happy with that :slight_smile:

Thanks everyone for the help !

.