Skip to content
Permalink
Browse files

Replaced public properties in cards with getters (thanks m4rcel for t…

…he feedback).
  • Loading branch information...
gou1 committed Mar 6, 2014
1 parent 8f566c5 commit 7063ef48d1e01a6dee71f0931e77b7a4bb3bd8ca
Showing with 35 additions and 18 deletions.
  1. +5 −8 README.md
  2. +16 −6 src/ManiaLib/Manialink/Cards/Box.php
  3. +14 −4 src/ManiaLib/Manialink/Cards/LabelBox.php
@@ -119,15 +119,12 @@ for($i = 0; $i < 5; $i++)
$ui = LabelBox::create()
->setPosn(0, -35)
->setSizen(100, 10)
->appendTo($frame)
->bg
->setStyle(Bgs1::BgTitle3)
->getParent()
->label
->setText('Much foobar')
->setTextSize(4)
->getParent()
->appendTo($frame);
$ui->bg()
->setStyle(Bgs1::BgTitle3);
$ui->label()
->setText('Much foobar')
->setTextSize(4);
$frame2 = Frame::create()
->setPosn(0, -50)
@@ -2,25 +2,35 @@
namespace ManiaLib\Manialink\Cards;
class Box extends \ManiaLib\Manialink\Elements\Frame
use ManiaLib\Manialink\Elements\Frame;
use ManiaLib\Manialink\Elements\Quad;
class Box extends Frame
{
/**
* @var \ManiaLib\Manialink\Elements\Quad
* @var Quad
*/
public $bg;
protected $bg;
function __construct()
{
parent::__construct();
$this->bg = new \ManiaLib\Manialink\Elements\Quad();
$this->appendChild($this->bg);
$this->bg = Quad::create()->appendTo($this);
}
function preFilterSize()
protected function preFilterSize()
{
parent::__construct();
$this->bg->setSizen($this->getSizenX(), $this->getSizenY());
}
/**
* @return Quad
*/
function bg()
{
return $this->bg;
}
}
@@ -10,16 +10,18 @@ class LabelBox extends Box
/**
* @var Label
*/
public $label;
protected $label;
function __construct()
{
parent::__construct();
$this->label = Label::create()->setBothAlign('center', 'center')->setPosn(0, 0, 0.1);
$this->appendChild($this->label);
$this->label = Label::create()
->setBothAlign('center', 'center')
->setPosn(0, 0, 0.1)
->appendTo($this);
}
function preFilterSize()
protected function preFilterSize()
{
parent::preFilterSize();
@@ -29,4 +31,12 @@ function preFilterSize()
}
}
/**
* @return Label
*/
function label()
{
return $this->label;
}
}

0 comments on commit 7063ef4

Please sign in to comment.
You can’t perform that action at this time.