示例#1
0
文件: Frame.php 项目: kremsy/manialib
 function buildXML()
 {
     if (!$this->xml) {
         $this->xml = Manialink::createElement($this->xmlTagName);
         $this->getParentNode()->appendChild($this->xml);
     }
     if ($this->id !== null) {
         $this->xml->setAttribute('id', $this->id);
     }
     if ($this->posX || $this->posY || $this->posZ) {
         $this->xml->setAttribute('posn', $this->posX . ' ' . $this->posY . ' ' . $this->posZ);
     }
     if ($this->scale !== null) {
         $this->xml->setAttribute('scale', $this->scale);
     }
     if ($this->getAttribute('clip')) {
         $this->xml->setAttribute('clip', $this->getAttribute('clip'));
     }
     if ($this->getAttribute('clipsizen')) {
         $this->xml->setAttribute('clipsizen', $this->getAttribute('clipsizen'));
     }
     if ($this->getAttribute('clipposn')) {
         $this->xml->setAttribute('clipposn', $this->getAttribute('clipposn'));
     }
 }
示例#2
0
 public function save()
 {
     if (!$this->xmlTagName) {
         return;
     }
     $this->xml = Manialink::createElement($this->xmlTagName);
     $this->getParentNode()->appendChild($this->xml);
     if ($this->id !== null) {
         $this->xml->setAttribute('id', $this->id);
     }
     if ($this->model !== null) {
         $this->xml->setAttribute('model', $this->model);
     }
     if ($this->color !== null) {
         $this->xml->setAttribute('color', $this->color);
     }
     if ($this->thickness !== null) {
         $this->xml->setAttribute('thickness', $this->thickness);
     }
     if ($this->gloss !== null) {
         $this->xml->setAttribute('gloss', $this->gloss);
     }
     if ($this->colorFloatRed !== null || $this->colorFloatGreen !== null || $this->colorFloatBlue !== null) {
         $this->xml->setAttribute('colorfloat', $this->colorFloatRed . ' ' . $this->colorFloatGreen . ' ' . $this->colorFloatBlue);
     }
 }