How do I set text to an array value at xy?

0 favourites
  • 5 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • hi, probably an easy answer, maybe im just rusty on arrays.

    x axis: 0 is herotype, 1 is level

    i spawn a text box and a sprite when x0>1 (theres a hero saved there)

    i need the text box to say the value at (1,y)

    im spawning and ordering all text boxes (multiple instances) but the text is just saying the last value in the "for each xy" loop

    using: on created "text box" set text to "Array.At(1,loopindex(Array.CurY))"

    i have tried multiple things... just happened to land on loopindex when posting this.

    ty

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 1 100

    1 50

    2 1

    i need hero type 1 to spawn, and his level text box to read lev100

    hero type 1 to spawn, and his level text box to read lev50

    hero type 2 to spawn, and his level text box to read lev1

  • Array.At(1,loopindex(Array.CurY))

    Try Array.At(1, Array.CurY)

    I prefer to use System loops when working with arrays:

    System For "y" from 1 to (Array.Height-1)

    Text append Array.At(1,loopindex)

  • good shout. running it as a loop that just reads values from the array is waay easier to keep track of

    i was getting all sorts of problems other than just setting a text

  • yeah. it works perfectly.

    array.at(curx,cury) just wasnt pulling the right answer.. and duplicating instances..

    doing it from a manual loop, everything works no problem.

    thanks for advice

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)