Text List ํ ์์ ฏ์ ํ
์คํธ์ ์๋ธ ํ
์คํธ๋ฅผ ๊ฐ์ด ์ฌ์ฉํ UI์
๋๋ค.
/**
* Widget Handle Function
* @param player Script Player Object
* @returns
*/
function openWidget(player)
{
if (player.isMobile) {
player.tag.widget = player.showWidget('widget.html', 'sidebar', 300, 500);
} else {
player.tag.widget = player.showWidget('widget.html', 'sidebar', 290, 460);
}
// send message to widget
player.tag.widget.sendMessage({
isMobile : player.isMobile,
});
// handle message from child frame(widget)
player.tag.widget.onMessage.Add(function(sender, msg) {
switch (msg.type)
{
case 'close':
if(sender.tag.widget)
{
sender.tag.widget.destroy();
sender.tag.widget = null;
}
break;
case 'submit':
sender.showAlert('OK');
break;
}
})
}
App.onJoinPlayer.Add(function(player) {
// Initialize tag properties of player
player.tag = {};
});
App.onSidebarTouched.Add(function(player) {
openWidget(player);
});