public function addCeil(LevelItem $item) { $item->setPosition($this->level, count($this->ceil)); $this->ceil[] = $item; return $this; }
private function rectangle($canvas, $x1, $y1, $x2, $y2, LevelItem $item) { $colors = $this->getColors($canvas); imagefilledrectangle($canvas, $x1 * $this->scale, $y1 * $this->scale, $x2 * $this->scale, $y2 * $this->scale, imagecolorallocate($canvas, hexdec(substr($item->getItem()->getId(), 0, 2)), hexdec(substr($item->getItem()->getId(), 2, 2)), hexdec(substr($item->getItem()->getId(), 4, 2)))); imagerectangle($canvas, $x1 * $this->scale, $y1 * $this->scale, $x2 * $this->scale, $y2 * $this->scale, $colors->borderMain); imagettftext($canvas, 7, 0, ($x1 + $item->getItem()->getLength() / 2 - 2) * $this->scale, ($y2 + $item->getItem()->getHeight() / 2) * $this->scale + 4, $colors->fillMain, __DIR__ . '/arial.ttf', $item->getItem()->getLength() . "x" . $item->getItem()->getWidth() . "x" . $item->getItem()->getHeight()); }