logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Loop through array values

    Scheduled Pinned Locked Moved
    Help and Support
    2
    6
    355
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TutorialDoctorT
      TutorialDoctor
      last edited by

      How would I loop through array values and update text with each?

      Jack8680J 1 Reply Last reply Reply Quote 0
      • Jack8680J
        Jack8680 @TutorialDoctor
        last edited by

        @TutorialDoctor the get array count behaviour (hidden under logic instead of with the other array behaviours) should let you loop through them pretty easily by getting array value with the index being the loop index:
        0_1502324805942_IMG_0047.PNG

        1 Reply Last reply Reply Quote 0
        • TutorialDoctorT
          TutorialDoctor
          last edited by

          What loop style or loop settings? When I output the array value to a text bubble it only shows the first item in the array.

          Jack8680J 1 Reply Last reply Reply Quote 0
          • Jack8680J
            Jack8680 @TutorialDoctor
            last edited by

            @TutorialDoctor just a regular repeating loop with the array count as the number of times. The loop will run in a single tick, so it'll probably only show a single value if you use set label or text bubble.

            1 Reply Last reply Reply Quote 0
            • TutorialDoctorT
              TutorialDoctor
              last edited by TutorialDoctor

              Thank you. I sorta got the effect I wanted but I'd like to trigger each cycle by a touch event (trying to create a visual novel dialogue box).

              0_1502344908386_IMG_3509.PNG

              Can't update a single label but it does update three different labels. Might as well not use the loop.

              Jack8680J 1 Reply Last reply Reply Quote 0
              • Jack8680J
                Jack8680 @TutorialDoctor
                last edited by

                @TutorialDoctor yeah, loops are for going through the items as fast as possible. Try something like this for what you want:
                0_1502355763738_IMG_0050.PNG

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post