# ForLoop on HUD Draw Text

Hi guys,

I want to create a BP HUD, where a text is printed via ForLoop as a HUD, with the same line and columns distance between them.

My base PB:

Right now, every loop creates this text : 45+ SizeX und 20+ SizeY

My goal is this : 5* 45+ SizeX 20+ SizeY - 5* 45+ SizeX .

I did look at the MemoryCard sample, but I don’t know how to apply it to my HUD.

My altered Cardsample:

Can anyone help me ?

SizeX and SizeY are floats that determine the position of the text being drawn. You’re asking how to multiply floats? If so, can you specify order of operations in the above line by parenthesis (or say its simply left to right)?

I feel like you might be having a harder problem than this and I’m just not understanding it correctly.

Hi ,

I make a image for better understand. Hope this Helps.

update:

Oh so you’re trying to do rows and columns at the same time? After 5 text items are drawn, go down to the next row and start below the first text item?

If that’s indeed your problem, you can use a term called “nested” For loops. It might not be the most efficient solution (others can chime in on this), but it would work.

Essentially, you plug a ForLoop into another ForLoop. For each row of X items, increment the inner loop Y times. So the first for loop would loop a total of 3 times (I’m looking at your images for reference to size), and each time through the loop it would hit the second ForLoop that looped 5 times with your original logic of printing 5 items in a row.

That’s a harder concept to explain than I thought it would be! If you still aren’t sure what I mean, google “nested for loops”.

That’s my theoretical solution, but someone may have a more efficient method (or I might’ve misunderstood your question again).

I struggled with this a few months ago but came up with a pretty easy way to do it. Im not at home at the moment but I’ll post a screenshot later. It can be done in about 5 or 6 nodes.

It involves using the forloop index and dividing it by the amount you want it to go right/left to produce a nice number.

If i want it to go right 5 times and spawn in 20. If it was on the 14th one, i would do:

14/5 = 2.8

With this number 2.8 i now know that its 80% to the right and on the 2nd row. Hope that helps, if not ill get the screenshot to you when i get home.

I’ll try it, a screenshot would be nice.

Hi zeOrb,

this works only with index 10. My Sample:

&d=1400591878

the result:

&d=1400591857

It works correct, actually! But not the way you want. “Append string” node add strings together and in result you print “Row number] + Cell number]”

If you want to print in each cell number of this cell - create local variable and just increase it by one each time you create new cell, then assign this value to string you want to print.

Thank you zeOrb, it works perfekt!

I know you’ve got it sorted but here’s the screenshot for you I said I’d post. Hopefully you still find it useful.

Wow pattym, that is awesome!