Example #1
0
 function postFilter()
 {
     parent::postFilter();
     if ($this->url !== null) {
         $this->xml->setAttribute('url', $this->url);
     }
 }
Example #2
0
 /**
  * Imports links and actions from another Manialink element
  * @param \ManiaLib\Gui\Element The source object
  */
 function addLink(\ManiaLib\Gui\Element $object)
 {
     $this->manialink = $object->getManialink();
     $this->url = $object->getUrl();
     $this->maniazone = $object->getManiazone();
     $this->goto = $object->getGoto();
     $this->action = $object->getAction();
     $this->actionKey = $object->getActionKey();
     if ($object->getAddPlayerId()) {
         $this->addPlayerId = 1;
     }
 }
Example #3
0
 /**
  * Returns the position of an element in relation to another element and
  * according to their respective alignments
  * 
  * @param \ManiaLib\Gui\Element Parent element
  * @param string Horizontal alignement of the element you want to place
  * @param string Vertical alignement of the element you want to place
  * @return array Calculated position of the element you want to place. The
  * array contains 2 elements with "x" and "y" indexes
  */
 public static final function getAlignedPos(\ManiaLib\Gui\Element $object, $newHalign, $newValign)
 {
     $newPosX = self::getAlignedPosX($object->getPosX(), $object->getRealSizeX(), $object->getHalign(), $newHalign);
     $newPosY = self::getAlignedPosY($object->getPosY(), $object->getRealSizeY(), $object->getValign(), $newValign);
     return array('x' => $newPosX, 'y' => $newPosY);
 }