Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - PHP / Javascript text to image generator | | | |
Pages: 1 2 | Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
Yarx Keese That Zelda Fanatic i am a wootest! Danicess Snuggle Slave! Fragapalooza! RTFM! Level: 20 Posts: 75/133 EXP: 37485 For next: 4954 Since: 03-15-04 From: Edmonton Since last post: 132 days Last activity: 18 days |
| ||
Ahh, I did that in mine. Making them multiple lines. Basically I assume you are tracking the X coordinate in the image correct? To know where the next letter goes? Well all you have to do is track a Y coodinate as well. When you want to jump to the next line, you increment Y by however far down the next line will be (Line Feed), and then set X to 0 so that it goes to the begining of the line (Carriage Return). As for resizing the base image. In mine, I step through the string and keep track of the height needed. Then after it's itterated through the entire string, I create my base image. Then using almost the exact same piece of code, do it again. Only this time I'm actually rendering the image, not just tracking coordinates for image size. |
|||
Weasel Missionary in Peru Level: 34 Posts: 396/454 EXP: 236444 For next: 17207 Since: 03-15-04 From: Washington Since last post: 467 days Last activity: 339 days |
| ||
My problem is that I just altered numgfx.php a bit, so I'm not really aware of how to use PHP's image functions. | |||
Elric Chasupa Currently Playing: You Like A Lute. Level: 40 Posts: 184/687 EXP: 440016 For next: 1293 Since: 03-15-04 From: Melniboné Since last post: 6 hours Last activity: 6 hours |
| ||
I did the same thing Weasel did. For me, that puts all the letters into a for(); loop:for($i=0;$i<$len;$i++){That's obviously not the whole code, but I think you get the idea. I know that one of those 8's in the ImageCopy(); at the end is the height, since all the letters in the font are 8x8. Just not sure which. |
|||
Xkeeper The required libraries have not been defined. Level: NAN Posts: -4147/-863 EXP: NAN For next: 0 Since: 03-15-04 Since last post: 2 hours Last activity: -753366 sec. |
| ||
And I made my own font. I didn't use one from another game You know, if you really want me to, I'll show you how I did it. I can't believe I did something so simple with just the idea from someone else; I coded it, and I know diddily squat about it. I just played with it. Hell, I even made this: Which, depending on the two numbers you give it, will generate different sized bars. If one goes over 100, the smaller one will shrink proportonately. And I did all of my work off of a modified numgfx, hence "numgfxl.php", for "numgfx long" [originally] or "numgfx letters" [just came up with it] Edit: Even my little Pulse script works off of the same engine, just using expthing.php or whatever it's called [it also uses ?n= hehe] I just downloaded the origonal Pulse script and had some fun... and if you notice, it ONLY does that with MY ID... any one else's will just return keys and rank (edited by Xkeeper on 06-12-04 12:36 AM) |
|||
tz Newcomer Level: 4 Posts: 3/4 EXP: 193 For next: 86 Since: 03-25-04 Since last post: 505 days Last activity: 339 days |
| ||
It was sort of a "phase" I went through, making these things for fonts from a lot of games; it definitely passed quickly though :| Also, it seems that I am doing variable width and character coordinate stuff differently from everybody else... Actually, instead of having to deal with coordinates in a multiple-character-high image, I first wrote a script to dissect the original font image and output an image that is only one character high, with the characters in ascii order. It might seem like a weird extra step, but it makes writing the invididual text output scripts a lot simpler. As for variable width, I just have an associative array that contains the widths of certain characters. I would post the source, but it is incredibly messy; perhaps I will clean it up, and then post it. (edited by tz on 06-13-04 09:06 AM) (edited by tz on 06-13-04 09:07 AM) |
|||
Elric Chasupa Currently Playing: You Like A Lute. Level: 40 Posts: 215/687 EXP: 440016 For next: 1293 Since: 03-15-04 From: Melniboné Since last post: 6 hours Last activity: 6 hours |
| ||
Spoiler: |
|||
tz Newcomer Level: 4 Posts: 4/4 EXP: 193 For next: 86 Since: 03-25-04 Since last post: 505 days Last activity: 339 days |
| ||
For the slash thing, try using stripslashes(). Also, I decided that since my FFT script is coded so poorly, cleaning it up will probably not help... so you can see it here. (edited by tz on 06-14-04 02:47 PM) (edited by tz on 06-14-04 03:02 PM) |
|||
Elric Chasupa Currently Playing: You Like A Lute. Level: 40 Posts: 223/687 EXP: 440016 For next: 1293 Since: 03-15-04 From: Melniboné Since last post: 6 hours Last activity: 6 hours |
| ||
Originally posted by tzI have no idea how to use that right. As I posted earlier, my stuff is in a for { if() } loop... This is how it's set up for the \ character: if($d=="\\") $d=80; I tried making it the following, all with no luck: if($d=="\\") $d=stripslashes(80); if($d=="\\") $d=stripslashes($_GET['80']); if($d=="\\") $d=stripslashes($_GET['d']); if($d=="\\") $d=stripslashes($_GET['d']) $d=80; I even tried just putting it near the top, like this: for($i=0;$i<$len;$i++){ $d=$n[$i]; $d=stripslashes(%_GET['d]); if($d=="A") $d=1; How should I do it? |
|||
Xkeeper The required libraries have not been defined. Level: NAN Posts: -4035/-863 EXP: NAN For next: 0 Since: 03-15-04 Since last post: 2 hours Last activity: -753366 sec. |
| ||
Alrighty, I'll show you how I did it soon enough. Just let me try and optimize it some more, kay? ^^ (edited by Neko-Areksuchan on 06-16-04 05:12 AM) |
|||
Elric Chasupa Currently Playing: You Like A Lute. Level: 40 Posts: 226/687 EXP: 440016 For next: 1293 Since: 03-15-04 From: Melniboné Since last post: 6 hours Last activity: 6 hours |
| ||
Sure, optimize away! Those fonts look nice, by the way. I need to make a good one. Hmm... |
Pages: 1 2 | Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - PHP / Javascript text to image generator | | | |