+ Antworten
Ergebnis 1 bis 10 von 13

Thema: Dynamic Server Image for LGSL - Help

Hybrid-Darstellung

Vorheriger Beitrag Vorheriger Beitrag   Nächster Beitrag Nächster Beitrag
  1. #1

    Registriert seit
    06.02.2012
    Beiträge
    8

    Dynamic Server Image for LGSL - Help

    Hi MadMakz!
    I have a couple of questions relating to Dynamic Server Image.

    1. How to implement a range of server load?
    Example -

    2. How can I accomplish this?
    Example -


    2. How can I correct encoding?
    Example -

  2. #2

    Registriert seit
    05.03.2010
    Alter
    33
    Beiträge
    155
    Regarding 1. & 2.: Never had my hands on that, these are extended vesions/features by thirds. you may put up a request on greycube.com.

    3.: Rewrite the pretty_text() code parts on case "sky" in "// LOCATIONS/TYPES" to use pretty_text_ttf() for UTF-8 support.

    Look at case "normal"/"small" for syntax. You probably have to change the textsizes then ($size4 & $size5 under "// TEXT COLOR & FORMATING. PLAY WITH IT!")


    My Wishlists: Amazon | Steam

  3. #3

    Registriert seit
    06.02.2012
    Beiträge
    8
    Erstellt von
    Code:
    else if ($type=="sky"){
    
    // DEFINE
    $im_map_width  = 130;
    $im_map_height = 120;
    $im_map_posx   = 25;
    $im_map_posy   = 112;
    
    $im_icon_width  = 16;
    $im_icon_height = 16;
    $im_icon_posx   = 26;
    $im_icon_posy   = 113;
    
    // Mapimage, Gameicon & Country
        imagecopyresampled($im, $im_map, $im_map_posx, $im_map_posy, 0, 0, $im_map_width, $im_map_height, $im_map_info[0], $im_map_info[1]);
    if($lookup['disabled'] == 0){
        imagecopyresampled($im, $im_icon, $im_icon_posx, $im_icon_posy, 0, 0, $im_icon_width, $im_icon_height, $im_icon_info[0], $im_icon_info[1]);
        if ($geoip==1){ imagecopyresampled($im, $cimage, $im_icon_posx + 112, $im_icon_posy, 0, 0, 16, 11, $cimage_info[0], $cimage_info[1]); }
    }
    // Servername
        pretty_text_ttf($im,$size4,6,28,substr($string0,0,34),$text_color1, $txt_outline);
    // IP:Port
        pretty_text_ttf($im,$size5,6,45,"IP:Port:  ".substr($string1,0,34)."",$text_color1, $txt_outline);
    // Map
        pretty_text_ttf($im,$size5,6,60,"    Map:  ".substr($string2,0,34)."",$text_color1, $txt_outline);
    // Players
        pretty_text_ttf($im,$size5,6,76,"Players:  ".substr($string3,0,34)."",$text_color1, $txt_outline);
    // Status
        pretty_text_ttf($im,$size5,6,92," Status:  ".substr($string4,0,34)."",$text_color1, $txt_outline);
     }
    Like that?

  4. #4

    Registriert seit
    05.03.2010
    Alter
    33
    Beiträge
    155
    yes, like that, just adjust the coordinations, the "6" repesents the pixel distance from the left, the other values (28, 45, 60...) repesent the distance from top of the background image.
    you may also replace $txt_outline by false, since TTF fonts become hard to read if they're small sized and use a outline.

    also, from the code i can see you're using an older version of LGSL-DSi, have a look on the latest snapshots (DSi 1.6+ for LGSL 5.8+). they have optimized code and support caching of images: http://community.spiffytek.com/downl...?do=file&id=11


    My Wishlists: Amazon | Steam

  5. #5

    Registriert seit
    05.03.2010
    Alter
    33
    Beiträge
    155
    here, this will go into the next commit to become the default for sky:

    pretty_text_ttf($im,$size4,0,5,15,$text_color1,$text_font0,substr($string0,0,19), $txt_outline); // Servername
    pretty_text_ttf($im,$size5,0,20,30,$text_color1,$text_font1,"IP:Port: ".$string1, $txt_outline); // IP:Port
    pretty_text_ttf($im,$size5,0,20,52,$text_color1,$text_font1,"Map : ".substr($string2,0,19), $txt_outline); // Map
    pretty_text_ttf($im,$size5,0,20,74,$text_color1,$text_font1,"Players: ".$string3, $txt_outline); // Players
    pretty_text_ttf($im,$size5,0,20,96,$text_color1,$text_font1,"Status : ".substr($string4,0,19), $txt_outline); // Status


    also change
    $size4 from 1 to 10
    and
    $size5 from 1 to 9

    demo:


    once i commit these changes there'll also be an option to print the servername vertical.
    demo:


    here's the preview diff of that http://labor.ml86.de/diff/?view=lgsl...lgsl_image.php
    Geändert von MadMakz (10.02.2012 um 01:36 Uhr)


    My Wishlists: Amazon | Steam

  6. #6

    Registriert seit
    06.02.2012
    Beiträge
    8
    Erstellt von

    I got, but why is the server name is not fully displayed

  7. #7

    Registriert seit
    06.02.2012
    Beiträge
    8
    Erstellt von

    Server Status displays in the boxes

+ Antworten

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •