protected function onConstruct()
 {
     $this->setLayer(\ManiaLive\Gui\Window::LAYER_CUT_SCENE);
     $this->setSize(self::SIZE_X, self::SIZE_Y);
     $this->setRelativeAlign('center', 'top');
     $this->setPosition(0, 84);
     $this->bg = new Elements\Quad(self::SIZE_X, self::SIZE_Y);
     $this->bg->setImage('file://Media/Manialinks/Common/Lobbies/header.png');
     $this->bg->setAlign('center');
     $this->addComponent($this->bg);
     $this->serverNameLabel = new Elements\Label(self::SIZE_X - 7);
     $this->serverNameLabel->setStyle(Elements\Label::TextRaceMessage);
     $this->serverNameLabel->setAlign('center', 'top');
     $this->serverNameLabel->setPosition(0, -4);
     $this->serverNameLabel->setTextSize(3);
     $this->addComponent($this->serverNameLabel);
     $this->avgWaitingTimeLabel = new Elements\Label(self::SIZE_X / 3);
     $this->avgWaitingTimeLabel->setAlign('right', 'center');
     $this->avgWaitingTimeLabel->setStyle(Elements\Label::TextRaceMessage);
     $this->avgWaitingTimeLabel->setPosition(self::SIZE_X / 2 - 5, -16);
     $this->avgWaitingTimeLabel->setTextId('avgWaiting');
     $this->avgWaitingTimeLabel->setTextSize(2);
     $this->avgWaitingTimeLabel->setOpacity(0.75);
     $this->addComponent($this->avgWaitingTimeLabel);
     $this->avgWaitingTimeHelperLabel = new Elements\Label(self::SIZE_X / 2);
     $this->avgWaitingTimeHelperLabel->setAlign('right', 'top');
     $this->avgWaitingTimeHelperLabel->setStyle(Elements\Label::TextRaceMessage);
     $this->avgWaitingTimeHelperLabel->setPosition($this->avgWaitingTimeLabel->getPosX(), -18);
     $this->avgWaitingTimeHelperLabel->setTextId('avgWaitingHelper');
     $this->avgWaitingTimeHelperLabel->setScale(0.5);
     $this->avgWaitingTimeHelperLabel->setOpacity(0.5);
     $this->addComponent($this->avgWaitingTimeHelperLabel);
     $this->playerCountLabel = new Elements\Label(self::SIZE_X / 3);
     $this->playerCountLabel->setAlign('left', 'center');
     $this->playerCountLabel->setStyle(Elements\Label::TextRaceMessage);
     $this->playerCountLabel->setPosition(-self::SIZE_X / 2 + 5, -16);
     $this->playerCountLabel->setOpacity(0.75);
     $this->playerCountLabel->setTextSize(2);
     $this->playerCountLabel->setTextid('nPlayers');
     $this->addComponent($this->playerCountLabel);
     $this->playerCountHelperLabel = new Elements\Label(self::SIZE_X / 2);
     $this->playerCountHelperLabel->setAlign('left', 'top');
     $this->playerCountHelperLabel->setStyle(Elements\Label::TextRaceMessage);
     $this->playerCountHelperLabel->setPosition($this->playerCountLabel->getPosX(), -18);
     $this->playerCountHelperLabel->setTextId('nPlayersHelper');
     $this->playerCountHelperLabel->setScale(0.5);
     $this->playerCountHelperLabel->setOpacity(0.5);
     $this->addComponent($this->playerCountHelperLabel);
 }
示例#2
0
 /**
  * @ignore
  */
 protected function preFilter()
 {
     $this->title->setPositionX($this->title->getPosX() + 9.5);
     $this->title->setSizeX($this->getSizeX() - $this->title->getPosX() - 2);
 }