0

I have an array of ints (I.E: 12 , 55 , 33) the length and contents of that array are variable. In a for each loop, I need to take every single array index and create a set number of ui images based on its number, for example if the first array element = 5, I need to create 5 images, then move on to the next element and do the same, and so on...

Can anybody help me with this please?

1
  • 1
    What are you stuck on? Creating a for loop to iterate over the array elements, doing something N times based on the entry or creating the image? Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Commented Oct 25, 2015 at 15:55

1 Answer 1

-1
foreach (int numImages in array) 
{
    for (int i = 1; i <= numImages; i++)
    {
        CreateImage();
    }        
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, but i'm using unreal blueprints...I'm not sure how this would translate to that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.