Sigx

We are the future in the past.
It is currently Sat Dec 14, 2019 4:34 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Apr 07, 2004 11:59 am 
Offline

Joined: Mon Apr 05, 2004 8:37 pm
Posts: 335
Location: /home/chair/sitting down/
well, if you have random backgrounds, and have had wanted to put different things in different locations on different backgrounds, here is your solution:

Image
http://dh5.net/sig/DHFlat04IPP-RNDwTxtLocation.php
currently i'm still working on getting the hits counter to move, and also to have the ip/port at the top to stick to the rest of the box... but for now, i'm just proving that it works and can be done

note: this is just a demonstration, so i spent about 10 seconds on each image and getting the location from each

reload the page to see the other locations, and how the text can move anywhere

--edit---

spent a bit more time on each image to put colored boxes, and get the locations and pass em into the code...

its just a demonstration, and looks like crap, but it works
i'll post the code modificatioins in a bit

_________________
Image
My Site: www.dh5.us
I'll kill you Brian Anderson


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 07, 2004 1:17 pm 
Offline

Joined: Mon Apr 05, 2004 8:37 pm
Posts: 335
Location: /home/chair/sitting down/
I know I should probably used edit..but .. this will help keep things simpler

Here is how you add the text locations code:
This setup also shows the code to add text locations for IP/Port and counter

Delete these lines first of all
Code:
$backIMG = "images/yourimage.PNG";
$Xoffset=3;
$Yoffset=20;


Find these lines:
Code:
// Code, Only edit if you know what you are doing!!
//////////////////////////////////////////////////

and add this after it... This will setup teh random skins, the place to put the data block, the place to put teh counter, and the place to put the ip/port info.
This is the only stuff you should have to go in and change the numbers on to get the text to position correctly.

Code:
// Random Skins AND text location mod by DarkHorizon

// Skin list
$skins = array("rskin1",
            "rskin2",
            "rskin3",
            "rskin4",
            );
// end of skin list

$x = rand(0,count($skins)-1); // select a random skin
$uskin = urlencode($skins[$x]); // skin names can have spaces! Yay
$nskin = $skins[$x];
$backIMG = "images/random/rskins/$uskin.PNG"; // tell it where to get the skins from

//// Time to program in the location for text... This could get annoying
////
// Skin1
    if( $nskin == rskin1 )
    {
   $Xoffset=20;
   $Yoffset=20;
   $counterx=81;
   $countery=142;
   $ippx=238;
   $ippy=139;
    }

// Skin2
    if( $nskin == rskin2 )
    {
   $Xoffset=30;
   $Yoffset=101;
   $counterx=473;
   $countery=159;
   $ippx=70;
   $ippy=40;
    }

// Skin3
    if( $nskin == rskin3 )
    {
   $Xoffset=127;
   $Yoffset=77;
   $counterx=15;
   $countery=173;
   $ippx=265;
   $ippy=23;
    }

// Skin4
    if( $nskin == rskin4 )
    {
   $Xoffset=16;
   $Yoffset=118;
   $counterx=41;
   $countery=48;
   $ippx=14;
   $ippy=84;
    }


//// Goddamn that was annoying.. but worth it

// End random skins and text location mod


now add this to Drawit - you should have to add it in 2 separate locations at the end inside the ( parenthesis )

Code:
drawIt(...All the stuff you already have..., $ippx, $ippy, $counterx, $countery);


now find

Code:
      imagestring ($im, $font, $Xoffset, ImageFontHeight($font) * $x + $Yoffset,  $data[$x], $fontColor);
      }
   } else {
      imagestring ($im, $font, $Xoffset, $Yoffset,  $data, $fontColor);


and replace with
Code:
      imagestring ($im, $font, $Xoffset, ImageFontHeight($font) * $x + $Yoffset,  $data[$x], $fontColor);         
      imagestring ($im, $font, $counterx, $countery, "Hits:$counter", $fontColor); // writec
      imagestring ($im, $font, $ippx, $ippy, $iptxt, $fontColor); // IP Port code
      }
   } else {
      imagestring ($im, $font, $Xoffset, $Yoffset,  $data, $fontColor);
      imagestring ($im, $font, $counterx, $countery, "Hits:$counter", $fontColor); // writec
      imagestring ($im, $font, $ippx, $ippy, $iptxt, $fontColor); // write ipport



if you don't have the Ip/port stuff setup yet, check here: http://forum.yuriy.net/phpbb/viewtopic.php?t=471

refer to http://forum.yuriy.net/phpbb/viewtopic.php?t=477 for more info about the random bg code

Right now, this should be all you have to do... If i forgot something, please point it out, if you need help, POST HERE

_________________
Image
My Site: www.dh5.us
I'll kill you Brian Anderson


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 07, 2004 2:07 pm 
Offline

Joined: Sat Mar 06, 2004 4:17 pm
Posts: 276
pretty damn cool, unique. I like it.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 07, 2004 6:13 pm 
Offline

Joined: Mon Mar 15, 2004 1:48 pm
Posts: 1395
Location: Los Angeles
pretty unique indeed. would be cooler if you had something better then what you have there. (plain background colors, kinda crappy...)

_________________
Image

Image

Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 07, 2004 8:40 pm 
Offline

Joined: Mon Apr 05, 2004 8:37 pm
Posts: 335
Location: /home/chair/sitting down/
hmm... for now i was just using this to display the functionality

I'll mess around in pshop when I have nuttin else to do

_________________
Image
My Site: www.dh5.us
I'll kill you Brian Anderson


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group