PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a basic script, which lets you just put txt=something here and it prints that out in the image, well, im trying to take it a little further, and im trying to get it to have gradient font, I havent the slightest clue on how I could do that...I can do single colors, but im not sure how I could get a gradient, Can anyone help me here?
If someone does not answer you, check back tomorrow sometime and I will have something for you. I have not seen anything that does text2gradient() so it sounded like it was neat thing to create! I got most of it done but I am off to the movies now so I will not have time to finish it right now. I was going to make it really simple but then I was thinking that it would be better to just make function that you pass the text to and also the info telling the function what you want done to it (gradientize) and the function will return the image resource so you can lay out the text on another image resource or you just call imagegif(), imagepng(), imagejpeg() and display it or put it in a file!
This is the array you will pass to the function text2gradient()
/*
* text array
*
* str = the string to gradientize (str)
* type = the gd function to use ( 0 = imagettftext(), 1 = imagestring() ) (int)
* size = the font size to use ( font size = 10 ) (int)
* gsc = the RGB starting color for the gradient array ( R, G, B ) (array), (int) values
* gec = the RGB ending color for the gradient array ( R, G, B ) (array), (int) values
* dir = the gradient direction ( 0 = left to right (horizontal), 1 = top to bottom (vertical) ) (int)
* path = the path and name to your font file ( if text array type = 0, else '' ) (str)
*
*/
:: QUICK NOTE::
To make the colors reverse [lite to dark, dark to lite], (gse, gec) just reverse the two arrays!