1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68:
<?php
/**
* An element in the signature. These are used for things like labels, avatars etc. A signature's width is calculated
* by the size of its elements.
*
* If {@link $usesSpace} is set to false, the element's sizes will not matter as they are ignored by width and height
* calculations.
*
* @author Lemmmy
*/
class Component
{
/**
* The X position of this component.
*
* @var int
*/
public $x;
/**
* The Y position of this component.
*
* @var int
*/
public $y;
/**
* Should the component count towards template size?
*
* @var bool
*/
public $usesSpace = true;
/**
* Initializes this component.
*
* @param OsuSignature $signature The base signature
* @param int $x The X position of this component
* @param int $y The Y position of this component
*/
public function __construct(OsuSignature $signature, $x = 0, $y = 0) {
$this->x = $x;
$this->y = $y;
}
/**
* @return int The width of this component. Overridable.
*/
public function getWidth() {
return 0;
}
/**
* @return int The height of this component. Overridable.
*/
public function getHeight() {
return 0;
}
/**
* Draws this component to the signature's canvas.
*
* @param OsuSignature $signature The signature to draw to.
*/
public function draw(OsuSignature $signature) {
}
}