steam_create_leaderboard

Create a new leaderboard for your game.

Syntax:

steam_create_leaderboard(lb_name, sort_method, display_type);


ArgumentDescription
lb_name The name of the leaderboard that you are creating (a string).
sort_method The method for sorting the leaderboard entries (see constants listed below).
display_type The way to display the leaderboard to the user (see constants listed below).


Returns: Real


Description

With this function you can create a new leaderboard for your game. The first argument is a string which defines the name of your leaderboard, and this name should be used in any further function calls relating to the leaderboard being created. You can then define the sort method (see the constants listed below) as well as the way in which the information is displayed (again, one of the constants listed below). The function will return a value of -1 if it fails to create the leaderboard or a value greater than -1 if it has succeeded.

NOTE: If you have previously created a leaderboard with the same name (either through code or through your Steam page for the game) this function will be ignored!

Sort ConstantDescription
lb_sort_noneNo sorting. The information will be displayed "as is".
lb_sort_ascendingSort the leaderboard in ascending order.
lb_sort_descendingSort the leaderboard in descending order.

Display ConstantDescription
lb_disp_noneShow the leaderboard "as is".
lb_disp_numericShow the leaderboard as a numeric display.
lb_disp_time_secShow the leaderboard values as times, with the base value being seconds.
lb_disp_time_msShow the leaderboard values as times, with the base value being milli-seconds.


Example:

steam_create_leaderboard("Game Times", lb_sort_ascending, lb_disp_time_sec);

The above code will create a leaderboard called "Game Times", and set it to display the results in ascending order and with a display in seconds.


Back: Steam API
Next: steam_upload_score

© Copyright YoYo Games Ltd. 2018 All Rights Reserved