Author Topic: Leader Board Help.  (Read 4303 times)

Bilko

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Leader Board Help.
« on: December 15, 2012, 06:11:31 AM »
Hey all;

I use UScript and I am trying to figure out the best approach to setting up my high score leader board. Right now I have a Input where the player enters their name along with a submit button. For the display portion of the leader board (where the name and score are shown) what do I use? UILable? and just set it to multiline? I only want the top 10 shown in this space so it would be a fixed size no need to be scrollable.

Basically the way I would set it up would be to pull the name from the name input and score when the submit button is clicked, then combine the two to be displayed in the leader board.

Any and all help is greatly appreciated. Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Leader Board Help.
« Reply #1 on: December 15, 2012, 04:02:33 PM »
UILabel will display text, yes. Seems like all you need is a label and give its 'text' property 10 names in the same string, separated by \n.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Leader Board Help.
« Reply #2 on: December 15, 2012, 08:38:41 PM »
Use a grid with a single label for each line. Consider using one label for Names and another for Score
UILabel Name             UILabel Score
Nicki                               1000001
Bilko                                    2130

Where the name is left aligned and score is right aligned.

The way it's typed into the system and the way you will be showing it on screen are two separate things - you just save the score and name in some data form and read that for your leaderboard.

Bilko

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: Leader Board Help.
« Reply #3 on: December 16, 2012, 05:50:58 AM »
Thanks for the feedback guys.

Quick Question, when you say create a grid, in what sense do you mean, ie how do you do that? Or are you talking about the layout of the labels that would form a grid?

And how did my score become last on the leader board Niki LOL

« Last Edit: December 16, 2012, 05:56:06 AM by Bilko »

dlewis

  • Guest
Re: Leader Board Help.
« Reply #4 on: December 16, 2012, 07:33:59 AM »
Quick Question, when you say create a grid, in what sense do you mean
Use the UIGrid script (part of ngui)

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Leader Board Help.
« Reply #5 on: December 16, 2012, 06:38:00 PM »
Yeah, look into the UIGrid.cs file.

As for the score, well, I've just played your game much more than you... :P