<?php

class MGDText extends MText
{
    public $ttfFont;
    public $key;
    public $location;
    public $size;
    public $foreColor;
    public $backColor;

    public function __construct( $name = '', $text = 'default', $size = 0, $fColor = array(0,0,0), $bColor = array(255,255,255), $ttfFont = 'arial', $bold = false )
    {
        parent::__construct( $name, $text, '', $color, NULL, $bold );
        $this->ttfFont = $ttfFont;
        $this->size = $size;
        $this->foreColor = $fColor;
        $this->backColor = $bColor;
        $this->manager->conf->loadConf('',$this->manager->getConf('home.classes') .'/etc/gdtext.xml');
        $this->key = $this->manager->getConf("gdtext.key");
    }

    public function generateInner()
    {
        $qs = 'key='.$this->key;
        $qs .= '&text='.$this->value;
        $qs .= '&size='.$this->size;
        $qs .= '&fcolor='.implode(',',$this->foreColor);
        $qs .= '&bcolor='.implode(',',$this->backColor);
        $qs .= '&font='.$this->ttfFont;
        $qs = 'qs='.base64_encode($qs);
        $a = $this->location = $this->manager->getConf('home.url').'/gdtext.php?'.$qs;
        $this->inner = $this->getRender( 'image' );
    }

}
?>