πŸ”ΉImage List

Image List μœ„μ ―μ€ 이미지와 ν…μŠ€νŠΈλ₯Ό ν•¨κ»˜ ν‘œμ‹œν•˜κ³  선택할 수 μžˆλŠ” UIμž…λ‹ˆλ‹€.

ν™œμš© 예) νƒ‘μŠΉ μ•±, 찌λ₯΄κΈ° μ•±, 아바타 특수 효과 λ“±

Image

Example

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',300,550);
    else
        p.tag.widget = p.showWidget('widget.html','sidebar',280,520);

    //Send data to widget
    p.tag.widget.sendMessage({
        isMobile : p.isMobile,
    })

    //Register events for messages sent from widgets
    p.tag.widget.onMessage.Add(function(sender, msg) {
        switch (msg.type)
        {
            case 'close':
                if(p.tag.widget)
                {
                    p.tag.widget.destroy();
                    p.tag.widget = null;
                }
                
                break;
            case 'submit':
                let choiceItem = msg.choice;
                p.showAlert('Item' + choiceItem);
                break;
        }
    })
}

//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

Was this helpful?