Esempio n. 1
0
function RenderName($name, $x, $y)
{
    global $character_id;
    global $im;
    global $imageoptions;
    global $options, $data_buffer;
    $background = imagecolorallocatealpha($im, 0, 0, 0, 33);
    $fontcolor = imagecolorallocate($im, 255, 255, 255);
    $startWidth = $x - CalculateStringWidth($name) / 2;
    $endWidth = $x + CalculateStringWidth($name) / 2;
    DrawNameBox($im, $startWidth, $y - 17, $endWidth - 1, $y - 2, $background);
    ImageTTFText($im, $imageoptions['font_size'], 0, $startWidth + 3, $y - 5, $fontcolor, $imageoptions['font'], $name);
    if ($options['guild_name'] != '') {
        $name = $options['guild_name'];
        $hasemblem = $options['guild_emblem_bg'] != 0 || $options['guild_emblem_bgc'] != 0 || $options['guild_emblem_fg'] != 0 || $options['guild_emblem_fgc'] != 0 ? true : false;
        $startWidth = $x - CalculateStringWidth($name) / 2;
        $endWidth = $x + CalculateStringWidth($name) / 2;
        DrawNameBox($im, $startWidth, $y, $endWidth - 1, $y + 15, $background);
        ImageTTFText($im, $imageoptions['font_size'], 0, $startWidth + 2, $y + 12, $fontcolor, $imageoptions['font'], $name);
        ImageTTFText($im, $imageoptions['font_size'], 0, $startWidth + 3, $y + 12, $fontcolor, $imageoptions['font'], $name);
        // Boldness
        if ($hasemblem) {
            if ($options['guild_emblem_bg'] != 0 || $options['guild_emblem_bgc'] != 0) {
                DrawImage($data_buffer['main-dir-guildemblem'] . '/0000' . $options['guild_emblem_bg'] . '/' . $options['guild_emblem_bgc'] . '.png', $startWidth - 18, $y + 0);
            }
            if ($options['guild_emblem_fg'] != 0 || $options['guild_emblem_fgc'] != 0) {
                DrawImage($data_buffer['main-dir-guildemblem'] . '/0000' . $options['guild_emblem_fg'] . '/' . $options['guild_emblem_fgc'] . '.png', $startWidth - 17, $y + 1);
            }
        }
    }
}
Esempio n. 2
0
function RenderName($name, $x, $y)
{
    global $character_id;
    global $im;
    global $font;
    global $font_size;
    global $__database;
    global $guild_info_location;
    $background = imagecolorallocatealpha($im, 0, 0, 0, 33);
    $fontcolor = imagecolorallocate($im, 255, 255, 255);
    $startWidth = $x - calculateWidth($name) / 2;
    $endWidth = $x + calculateWidth($name) / 2;
    DrawNameBox($im, $startWidth, $y - 17, $endWidth - 1, $y - 2, $background);
    ImageTTFText($im, $font_size, 0, $startWidth + 3, $y - 5, $fontcolor, $font, $name);
    $q = $__database->query("SELECT g.name, g.emblem_bg, g.emblem_bg_color, g.emblem_fg, g.emblem_fg_color FROM guild_members c INNER JOIN guilds g ON g.id = c.guild_id WHERE c.character_id = " . $character_id);
    if ($q->num_rows == 1) {
        $res = $q->fetch_array();
        $name = $res[0];
        $hasemblem = $res[1] != 0 || $res[2] != 0 || $res[3] != 0 || $res[4] != 0 ? true : false;
        $startWidth = $x - calculateWidth($name) / 2;
        $endWidth = $x + calculateWidth($name) / 2;
        DrawNameBox($im, $startWidth, $y, $endWidth - 1, $y + 15, $background);
        ImageTTFText($im, $font_size, 0, $startWidth + 2, $y + 12, $fontcolor, $font, $name);
        ImageTTFText($im, $font_size, 0, $startWidth + 3, $y + 12, $fontcolor, $font, $name);
        // Boldness
        if ($hasemblem) {
            if ($res[1] != 0 || $res[2] != 0) {
                add_image($guild_info_location . '/BackGround/0000' . $res[1] . '/' . $res[2] . '.png', $startWidth - 18, $y + 1);
            }
            if ($res[3] != 0 || $res[4] != 0) {
                $name = "";
                $sort = floor($res[3] / 1000);
                if ($sort == 2) {
                    $name = "Animal";
                } elseif ($sort == 3) {
                    $name = "Plant";
                } elseif ($sort == 4) {
                    $name = "Pattern";
                } elseif ($sort == 5) {
                    $name = "Letter";
                } elseif ($sort == 9) {
                    $name = "Etc";
                }
                add_image($guild_info_location . '/Mark/' . $name . '/0000' . $res[3] . '/' . $res[4] . '.png', $startWidth - 17, $y + 2);
            }
        }
    }
}