Write text on material at runtime

Hi,

I wanna generate random text and place it on my object in the world.

I have been struggling with for the last 4 hours with canvas 2d render targets, bind even on update, dynamic material,etc.

I cant get anything to work. anyone have any idea or resources?

Thanks

Hi there, welcome to community.

There are couple of ways to do it. Assuming you want it on material level on the mesh object.

1- (As you do ) You can make a RenderTarget, put a WidgetComponent, Take a snapshot etc. Then put the RenderTarget inside the material and it’s done. However this is generally I don’t advice doing, since it’s not necessary if its just Text or Numerals. If there is complex shapes, moving textures then you can prefer.

2- You can take a look at this one, it’s basically a sprite and you change texture UV to match whatever you want to print.

3- If it’s more complex shapes, you want to use RenderTarget to make something more fancy and updates with ease then you can take a look at this one. On step 5 you can simply make an update, render widget to a texture. There are details of update rate etc. in that post entirely.

4- You can actually FontSample in materials so FontSampleNode->BoxMask->UVPanner is similar to 1st but more modern and dynamic.

Let us know.