Populating a list or listbox at design time?

This forum is currently in read-only mode.
  • Hi all.

    I have a database of text with over 2000 entries (and soon to be many more) that I want to populate a list or listbox with at design time, rather than have them loaded at runtime.

    I've looked at both the list and listbox, but as far as I can see, there's no way of pasting any information into it.

    I may have to create a binary file with all this info in it, and read what I want when I want it, but I'd rather go with using a list or listbox (but I'm not going to enter each piece of text by hand!)

    So, is it possible to paste a clipboard into one of the lists at design time?

    If not, consider this a feature request?

    Krush.

  • Well, the deafening silence suggests my fears are founded.

    It looks like I'll have to go down the binary file route.

    Krush.

  • Well, the deafening silence suggests my fears are founded.

    It looks like I'll have to go down the binary file route.

    BTW, why is the forum so slow these days?

    Gone from a fraction of a second to display a page to 30-60 seconds.

    This is the only website that I have this problem with.

    Krush.

  • If you are adding more than a handful of initial items - especially as many as 2000 - I'd recommend an external file anyway. I doubt it'd be convenient to have that many items in the editor.

  • Yeah, I'll find another way of doing it, although a couple of thousand entries in a dropbox or list isn't that many in memory terms.

    And it's not for the end user to select from anyway.

    It was just a way of keeping the list internal to the game.

    I've a few things in mind.

    P.S. Again, the forum seems to be dying, speed-wise, and that double post must be down to it too because I was editing the post, not posting a new one.

    Krush

  • I've contacted the host about the forum slowness, hopefully they'll sort it out soon.

  • Yeah, I'll find another way of doing it, although a couple of thousand entries in a dropbox or list isn't that many in memory terms.

    And it's not for the end user to select from anyway.

    It was just a way of keeping the list internal to the game.

    You could always populate your list from a text object. You could even use instances with PVs if you have multiple lists. I used text objects with INI info in them to load levels in Vert, in order avoid having a pile of .lvl files hanging around. They're just all tucked away on a hidden and locked layer.

    I'm sure you could do something similar to keep from having external text lists.

  • On my initial search of the forums when I started this thread, I came across your "text" object method in another thread where you were explaining it to someone else, but I haven't got around to looking at it yet.

    Each line of data is on a separate line in the text file, and hence in a text object, like so:

    fdsiksadflkhj

    sfgpdisdfj

    sdpusdpg9su

    wrt90gjigfdklj

    sdgf0gsdjipjgfd

    rtew9u

    dspjdfgpiuvc-u

    Is there a way of reading the text.text contents line by line to populate a listbox?

    I didn't think a text object could be manipulated this way.

    I'm not sure if transferring the text contents to the Text Manipulator would enable me to read it line by line either, but from what I can remember it doesn't.

    Krush.

  • You can populate a list box at runtime from an external txt file.

    +Start Of Layout

    Listbox Load From File

    Or have I misread what your after achieving.

  • Or have I misread what your after achieving.

    I'm afraid you have.

    I'm trying to hold thousands of pieces of data internal to the app.

    So, placing them into a list at design time.

    Krush.

  • > Or have I misread what your after achieving.

    >

    I'm afraid you have.

    I'm trying to hold thousands of pieces of data internal to the app.

    So, placing them into a list at design time.

    Krush.

    Ah. It isn't the first time and won't be the last.

    Although usually when I miss read the situation I end up with a kick in the nuts, a slap in the chops or a white wine spritzer in the face.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, I've finally cracked it.

    The TextManipulator object had more functions than I thought when I took a good look at it, so by copying the contents of the text object over to it, I can select, replace and delete any of the entries in the TextManipulator, which is all the functionality that I need.

    If you ever need to parse a normal text object with data on each line, it's as simple as using Newline as the delimiter in the TextManipulator.

    Now, seeing as the SpriteFont plugin isn't 100% bug-free yet, my next task is to write my own limited version within Construct to do what I need (I already have this sorted in my head at least )

    Thanks for the help guys.

    Krush.

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