๐นRanking List
Ranking List ํ ์์ ฏ์ ํ๋ ์ด์ด์ ๋ญํน์ ์ ๋ ฌํ UI์
๋๋ค.
ํ์ฉ ์ ) ๋ฌ๋ฆฌ๊ธฐ ๊ณต์ ๋งต, ๊ฒฐํฌ์ฅ ๊ณต์ ๋งต, ์น๋ถ ์์ธก ์ฑ, ํฌ์ธํธ ์ฑ
Image
Example
const dummyData = {
'a': {
id: 'a',
name: 'user1',
point: 100,
},
'b': {
id: 'b',
name: 'user2',
point: 200,
},
'c': {
id: 'c',
name: 'user3',
point: 400,
},
'd': {
id: 'd',
name: 'user4',
point: 1000,
},
'e': {
id: 'e',
name: 'user5',
point: 2000,
},
'f': {
id: 'f',
name: 'user6',
point: 4000,
},
};
function openWidget(p)
{
//Check if player is mobile or not
if (p.isMobile)
//Set the widget's name, anchor position, width, and height.
p.tag.widget = p.showWidget('widget.html', 'sidebar', 350, 480);
else
p.tag.widget = p.showWidget('widget.html', 'middle', 400, 448);
//Send data to widget
p.tag.widget.sendMessage({
data: dummyData,
id: p.id,
isMobile: p.isMobile,
});
//Register events for messages sent from widgets
p.tag.widget.onMessage.Add(function (sender, msg) {
if (msg.type == "close") {
if (sender.tag.widget) {
sender.tag.widget.destroy();
sender.tag.widget = null;
}
}
});
}
//Event when a player joins the app
App.onJoinPlayer.Add(function(p) {
//Reset the player's tag value
p.tag = {};
});
// Action when the player clicks the sidebar app
App.onSidebarTouched.Add(function(p) {
openWidget(p);
});
Last updated