Download

How to use a blueprint macro to make instances of itself in runtime .

I have a macro that displays a texture ( Inside of my HUD class ), and it has to add textures to the screen in different position anytime the player does something, and i don’t want to make tons of copies of that macro and to hope the player wont need more, is there any way to do this in blueprint ?

o_O! umm Spawn

Thanks, But even if i spawn multiple instances of my HUD class the player will see only one…

What i need is like node that make nodes in runtime or something like that…

Just put the texture drawing section in a loop, and then extend the loop at runtime. Should be fairly simple.

I don’t really understand… can you put an example please ?

as work around… I have a interface that send textures to the hud, some time it show one, two, or three button.
you can put, for example, 20 “draw texture” nodes and you interface other 20 outputs. Create a manager to send textures who work with you macro.

sendTextures01.JPG

sendTextures.JPG

Make a for loop and put the texture drawing macro inside the loop body. Depending on what you are doing, you can then procedurally generate screen coordinates, or simply pull them out of a precomputed array or something like that. Let’s say you are trying to draw three hearts. You will probably have an integer that contains this number. Make your loop max index reflect that integer. Then simply do math as needed to determine screen position.