Gucci Mane Posted October 6, 2009 Share Posted October 6, 2009 Is it possible to put an image as a a username? Quote Link to comment Share on other sites More sharing options...
reek13 Posted October 6, 2009 Share Posted October 6, 2009 Yes . just go to the staff panel then go to edit users and put the image url as the username , and the image should come up as the name . I once did this a couple months ago so tell me if it works Quote Link to comment Share on other sites More sharing options...
Gucci Mane Posted October 6, 2009 Author Share Posted October 6, 2009 I got it but reek13 thats not the way but ty for trying to help. all is love, TSMW Quote Link to comment Share on other sites More sharing options...
Taxed Posted October 6, 2009 Share Posted October 6, 2009 why would you want to put an image as a username in the first place? Quote Link to comment Share on other sites More sharing options...
Gucci Mane Posted October 6, 2009 Author Share Posted October 6, 2009 A small custom made .png heres and ex of my game with that name[attach]1369[/attach] Quote Link to comment Share on other sites More sharing options...
mdshare Posted October 6, 2009 Share Posted October 6, 2009 You can also use the GD Lib to create a img for the username example <? // MakeWebGames.com :: Example of using the GD Library to change txt to img header("Content-type: image/gif"); if(!$_GET['len']) $_GET['len']=100; if(!$_GET['height']) $_GET['height']=40; if(!$_GET['size']) $_GET['size']=20; if(!$_GET['hline']) $_GET['hline']=$_GET['height']/2; $image=imagecreate($_GET['len'],$_GET['height']); $bg_colour = imagecolorallocate($image, 230, 230, 230); $txt_colour = imagecolorallocate($image, 0x5F, 0x27, 0x25); $trans=imagecolortransparent ($image ,$bg_colour); imageantialias ($image,off); imagettftext($image,$_GET['size'],0,0,$_GET['hline'],$txt_colour,'dearJoe_4_trial.otf',$_GET['string']); imagegif($image); imagedestroy($image); ?> as attachment the OTF and a example GIF created with the above Quote Link to comment Share on other sites More sharing options...
Danny696 Posted October 6, 2009 Share Posted October 6, 2009 Nice Md, How would you use that in the sctipt itself? Quote Link to comment Share on other sites More sharing options...
mdshare Posted October 6, 2009 Share Posted October 6, 2009 I wouldn't use it in the game script itself as it uses CPU power as memory from the server What I would do is having at the signup create the username as gif and fwrite it to a file eg to /user/{username}.gif ingame you simply call the username as a img src then example of creating a img without proxying it to a browser <?php // Create a test source image for this example $im = imagecreatetruecolor(300, 50); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color); // start buffering ob_start(); // output jpeg (or any other chosen) format & quality imagejpeg($im, NULL, 85); // capture output to string $contents = ob_get_contents(); // end capture ob_end_clean(); // be tidy; free up memory imagedestroy($im); // lastly (for the example) we are writing the string to a file $fh = fopen("./temp/img.jpg", "a+" ); fwrite( $fh, $contents ); fclose( $fh ); ?> Quote Link to comment Share on other sites More sharing options...
Gucci Mane Posted October 6, 2009 Author Share Posted October 6, 2009 what I did was make the image. Upload to cpanel then edit user and for there username I put <img scr=filename.png> where it says file name, change that to w/e the image you uploaded to your cpanels name ex. you make a image upload to cpanel as testimg.png you would put <img scr=testimg.png> in the users username Quote Link to comment Share on other sites More sharing options...
mdshare Posted October 6, 2009 Share Posted October 6, 2009 that woks also , but what if 1000 players want's to have a img as username .... I was looking into a method for you how to auto generate a gif/jpg for the members and have it displayed as gif instead of a txt username (without going to edit the username field) Quote Link to comment Share on other sites More sharing options...
Nickson Posted October 6, 2009 Share Posted October 6, 2009 @ThaSkiMaskWay: Yes your way of doing this works fine, however imagine yourself making about a few thousands, if not a million, username images just because a user changes his name? It can all work fine, however this isn't automated, you have to spend time doing it (even though, adding a new layer with a username doesn't take long, you still have to upload it, and edit a users settings). What mdshare did here, is post the base of a script that would automate this process. This means that you wouldn't need to spend creating a new image each time a user changes his or her nickname - which can be a real pain if you have quite a userbase! Therefore automating this event, would give you more time to spend on other things, while users get there images quite instantly, with the possibility of adding extra options to the script. They're happy, you are probably happy too. And once it's made, you actually don't have to look at it anymore - unless you want to change the base image - which takes up a little bit of time and you're good again. But keep in mind that having such a script comes with a price! It isn't a php version of photoshop, and it's quite heavy on resources, yet this can have quite a lot of possibilities. I hope this can clear up some extra things. Quote Link to comment Share on other sites More sharing options...
Gucci Mane Posted October 6, 2009 Author Share Posted October 6, 2009 well...thats the point its a donator item, say 50 bucks for it and every change after you have 1 apllied is for say 20 bucks Quote Link to comment Share on other sites More sharing options...
Uridium Posted October 6, 2009 Share Posted October 6, 2009 Ive been working with GD LIB recently on another mod and found that for MCCODES it has a large potential for some great mods. Quote Link to comment Share on other sites More sharing options...
Gucci Mane Posted October 7, 2009 Author Share Posted October 7, 2009 wot ya mean bro? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.