Class: Leaderboard#

Hierarchy#

  • Handle<leaderboard>

    ↳ Leaderboard

Constructors#

constructor#

new Leaderboard(): Leaderboard

Create a Leaderboard object

note Leaderboards initially have 0 rows, 0 columns, and no label.

bug Do not use this in a global initialisation as it crashes the game there.

Returns: Leaderboard

Defined in: handles/leaderboard.ts:6

Properties#

handle#

• Readonly handle: leaderboard

Inherited from: Handle.handle

Defined in: handles/handle.ts:6

Accessors#

displayed#

displayed(): boolean

Returns: boolean

Defined in: handles/leaderboard.ts:36


id#

id(): number

Get the unique ID of the handle. The ID is recycled once you destroy the object.

Returns: number

The unique ID of a handle object.

Defined in: handles/handle.ts:18


itemCount#

itemCount(): number

Returns: number

Defined in: handles/leaderboard.ts:40

itemCount(count: number): void

Parameters:#

NameType
countnumber

Returns: void

Defined in: handles/leaderboard.ts:44


label#

label(): string

Returns: string

Defined in: handles/leaderboard.ts:116

label(value: string): void

Parameters:#

NameType
valuestring

Returns: void

Defined in: handles/leaderboard.ts:112

Methods#

addItem#

addItem(label: string, value: number, p: MapPlayer): void

Parameters:#

NameType
labelstring
valuenumber
pMapPlayer

Returns: void

Defined in: handles/leaderboard.ts:20


clear#

clear(): void

Returns: void

Defined in: handles/leaderboard.ts:24


destroy#

destroy(): void

Returns: void

Defined in: handles/leaderboard.ts:28


display#

display(flag?: boolean): void

Parameters:#

NameTypeDefault value
flagbooleantrue

Returns: void

Defined in: handles/leaderboard.ts:32


getPlayerIndex#

getPlayerIndex(p: MapPlayer): number

Parameters:#

NameType
pMapPlayer

Returns: number

Defined in: handles/leaderboard.ts:48


hasPlayerItem#

hasPlayerItem(p: MapPlayer): void

Parameters:#

NameType
pMapPlayer

Returns: void

Defined in: handles/leaderboard.ts:52


removeItem#

removeItem(index: number): void

Parameters:#

NameType
indexnumber

Returns: void

Defined in: handles/leaderboard.ts:56


removePlayerItem#

removePlayerItem(p: MapPlayer): void

Parameters:#

NameType
pMapPlayer

Returns: void

Defined in: handles/leaderboard.ts:60


setItemLabel#

setItemLabel(item: number, label: string): void

Parameters:#

NameType
itemnumber
labelstring

Returns: void

Defined in: handles/leaderboard.ts:64


setItemLabelColor#

setItemLabelColor(item: number, red: number, green: number, blue: number, alpha: number): void

Parameters:#

NameType
itemnumber
rednumber
greennumber
bluenumber
alphanumber

Returns: void

Defined in: handles/leaderboard.ts:68


setItemStyle#

setItemStyle(item: number, showLabel?: boolean, showValues?: boolean, showIcons?: boolean): void

Parameters:#

NameTypeDefault value
itemnumber-
showLabelbooleantrue
showValuesbooleantrue
showIconsbooleantrue

Returns: void

Defined in: handles/leaderboard.ts:72


setItemValue#

setItemValue(item: number, value: number): void

Parameters:#

NameType
itemnumber
valuenumber

Returns: void

Defined in: handles/leaderboard.ts:76


setItemValueColor#

setItemValueColor(item: number, red: number, green: number, blue: number, alpha: number): void

Parameters:#

NameType
itemnumber
rednumber
greennumber
bluenumber
alphanumber

Returns: void

Defined in: handles/leaderboard.ts:80


setLabelColor#

setLabelColor(red: number, green: number, blue: number, alpha: number): void

Parameters:#

NameType
rednumber
greennumber
bluenumber
alphanumber

Returns: void

Defined in: handles/leaderboard.ts:84


setPlayerBoard#

setPlayerBoard(p: MapPlayer): void

Parameters:#

NameType
pMapPlayer

Returns: void

Defined in: handles/leaderboard.ts:88


setStyle#

setStyle(showLabel?: boolean, showNames?: boolean, showValues?: boolean, showIcons?: boolean): void

Parameters:#

NameTypeDefault value
showLabelbooleantrue
showNamesbooleantrue
showValuesbooleantrue
showIconsbooleantrue

Returns: void

Defined in: handles/leaderboard.ts:92


setValueColor#

setValueColor(red: number, green: number, blue: number, alpha: number): void

Parameters:#

NameType
rednumber
greennumber
bluenumber
alphanumber

Returns: void

Defined in: handles/leaderboard.ts:96


sortByLabel#

sortByLabel(asc?: boolean): void

Parameters:#

NameTypeDefault value
ascbooleantrue

Returns: void

Defined in: handles/leaderboard.ts:100


sortByPlayer#

sortByPlayer(asc?: boolean): void

Parameters:#

NameTypeDefault value
ascbooleantrue

Returns: void

Defined in: handles/leaderboard.ts:104


sortByValue#

sortByValue(asc?: boolean): void

Parameters:#

NameTypeDefault value
ascbooleantrue

Returns: void

Defined in: handles/leaderboard.ts:108


fromHandle#

static fromHandle(handle: leaderboard): Leaderboard

Parameters:#

NameType
handleleaderboard

Returns: Leaderboard

Defined in: handles/leaderboard.ts:120


fromPlayer#

static fromPlayer(p: MapPlayer): Leaderboard

Parameters:#

NameType
pMapPlayer

Returns: Leaderboard

Defined in: handles/leaderboard.ts:124