Type-A

Type-A๋Š” ๋ฏธ๋‹ˆ๊ฒŒ์ž„์˜ ์ข…๋ฅ˜๋ฅผ ์•Œ๋ ค์ค„ ๋•Œ ์ธํŠธ๋กœ Custom Label๋กœ ์ž์ฃผ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

์ด๋ฏธ์ง€

์˜ˆ์ œ์ฝ”๋“œ

function showLabelTypeA(player, key, text1, text2) {
    const isMobile = player.isMobile;
    const topGap = isMobile ? 10 : -2; // gap between top and label ( mobile 60px,  pc 48px ) 60px, pc๋Š” 48px์ด ๋˜๋„๋ก ์„ค์ •ํ•œ ๊ฐ’
    /**
     * Size-based @labelPercentWidth
     * XL: isMobile ? 90 : 50;
     * L: isMobile ? 80 : 40;
     * M: isMobile ? 70 : 28;
     * S: isMobile ? 60 : 20
     */
    const labelPercentWidth = isMobile ? 70 : 28;
    const labelDisplayTime = 300000;

    const parentStyle = `
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center;
    `;

    const firstRowStyle = `
    font-size: ${isMobile ? "14px" : "18px"};
    font-weight: 700; 
    color: white;`;

    const secondRowStyle = `
    font-size: ${isMobile ? "16px" : "24px"};
    font-weight: 800;
    color: #FFEB3A;`;

    const customLabelOption = {
        key: key,
        borderRadius: "12px",
        fontOpacity: false,
        padding: "8px",
    };

    let htmlStr = `<span style="${parentStyle}">
        <span style="${firstRowStyle}">${text1}</span>
        <span style="${secondRowStyle}">${text2}</span>
    </span>`;

    player.showCustomLabel(htmlStr, 0xffffff, 0x27262e, topGap, labelPercentWidth, 0.64, labelDisplayTime, customLabelOption);
}

Last updated