public function setY($y) { if ($y >= 0) { // Absolute value. $this->y = $y; } else { // Negative, so relative to bottom edge of the page. $this->y = $this->h + $y; } }