Results 1 to 3 of 3

Thread: Using TileList

  1. #1
    MSgt. Shooter Person
    Join Date
    Dec 2009
    Posts
    144

    Default Using TileList

    Hi all,

    I understand that a server browser should be in essence a TileList.

    I know how to access back and forth between actionscript and unrealscript.

    What I do not understand is how to set up the TileList.

    Allar's great screenshot really shows what I mean.

    This Image Was Automatically Resized by using the Screenshot Tag.  Click to view the full version

    I would like help on getting:
    5 columns of differing sizes.
    Help on understanding how to input data into each tile.

    Currently I use a dataprovider (to try it out) like so;

    Code:
    this.ServerList.dataProvider = ["Server1.", "Server2", "Server3", "Server4", "Server5"];
    This only enters data for the first column of each row. How to do I enter data for the rest of the columns?

    Any help on this would be great. As you could probably tell, my weakest area is actionscript.
    BA (Hons) Games Design.
    C# .NET Programmer, C++ Programmer, 3D Design Artist.

    Project: CQB on IndieDB

  2. #2

    Default

    Multiple columns are typically achieved using the following code:

    Code:
    list.dataProvider = [{col1: "something cool", col2: "something awesome"},
    {col1: "something nice", col2: "something naughty"}];
    The following comes from our CLIK user's guide (released to licensees):

    The TileList automatically will use the property named 'label' if found in the item object:

    Code:
    list.dataProvider = [{label: "one", data:1}, {label: "two", data:2}];
    However if the item object has a different label property, such as the following, then the list can be configured to use that property instead:

    Code:
    list.labelField = "name";
    list.dataProvider = [{name: "one", data:1}, {name: "two", data:2}];
    If the logic to construct a label from the item object is complicated and requires a function, then set the labelFunction property:

    Code:
    list.labelFunction = function(itemObj:Object):String {
    // Logic to construct a label
    }
    list.dataProvider = [{p1: "foo", p2: 1}, {p1: "bar", p2: 2}];
    Last edited by Matt Doyle; 10-13-2010 at 12:09 PM.

  3. #3
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    341

    Default

    The way Matt described is probably the best way to do it, however when I tried that attempt I couldn't get it functioning like I wanted (mainly because I'm not the best in actionscript). In any case, I made a class derived from TileList with functions that would automatically handle turn a server data struct I created and i'd pass the struct into the data provider, with another class i derived from TileListRenderer using this to format and display the data correctly.

    Hopefully that makes as much sense as it does in my head.
    Follow me on my new twitter. <_<
    http://twitter.com/#!/MichaelAllar

    Things I've made/worked/working on with UDK/UE3 that I can publicly talk about:
    Rekoil
    Warm Gun
    Jump or Die
    StuffIt: Playroom

    Allar's (Now outdated but soon to be updated) Complete Guide of UnrealScript


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.