Location: PHPKode > scripts > Texture Background Effect > texture-background-effect/FXText.class.php
<?php
/*///////////////////////////////////////////////*/
/*//              FXText.class.php             //*/
/*///////////////////////////////////////////////*/
/*
                  Animation.class.php
                Created by László Zsidi
                 hide@address.com
                 ----------------------
   A liszensze ennek a Class-nek megváltozott és Freeware
   lett.
   Szabadon használható ingyenes és kereskedelmi jelleg&#369;
   oldalakon, valamint publikálható és terjeszthet&#337;, de
   a forráskód nem módosítható a szerz&#337; beleegyezése nélkül.
   Ha használod a kódokat kérlek helyezz el egy felém mutató
   linket.
   =======================================================
   Licence of This class has been changed freeware!
   Can be used for freeware or commercial services,
   can be distributed anywhere but cannot be modified sourcecode
   without permission of author.
   If you use this class please refer with a link to me.
*/
class FXText
{
	var $fw;
	var $fh;
	var $bw;
	var $bh;
	var $fr;
	var $sr;
	var $bg;
	var $fg;
	var $pt;

	function FXText($fw, $fh, $bw, $bh, $fr, &$sr, &$bg, &$fg)
	{
		$this->fw = $fw;
		$this->fh = $fh;
		$this->bw = $bw;
		$this->bh = $bh;
		$this->fr = $fr;
		$this->sr = $sr;
		$this->bg = $bg;
		$this->fg = $fg;
		$this->pt = $this->CreateBackground();
	}
	function CreateBackground()
	{
		for($oy=0; $oy < $this->fh + 15; $oy = $oy + $this->bh)
			for($ox=0; $ox < $this->fw + 15; $ox = $ox + $this->bw)
		    	imagecopy($this->bg, $this->sr, $ox, $oy, 0, 0, $this->bw, $this->bh);
					return $this->bg;
	}
	function CreateFrames($offset)
	{
		$f = imageCreateTrueColor(imageSX($this->fg), imageSY($this->fg));
		$w = imageColorAllocate($f, 255, 255, 255);
		imagefill($f, 0, 0, $w);
		imagecopy($f, $this->pt, 0, 0, $offset, $offset, $this->fw, $this->fh);
		imagecopy($f, $this->fg, 0, 0, 0, 0, $this->fw, $this->fh);
		ob_start();
		imageGif($f);
		$r = ob_get_contents();
		ob_end_clean();
        imageDestroy($f);
        return $r;
	}
}
?>
Return current item: Texture Background Effect