PHP Class Grafika\Position

Datei anzeigen Open project: kosinix/grafika Class Usage Examples

Public Methods

Method Description
__construct ( string $position = 'center', integer $offsetX, integer $offsetY ) Position constructor.
getOffsetX ( ) : integer
getOffsetY ( ) : integer
getText ( ) : string
getXY ( integer $canvasWidth, integer $canvasHeight, integer $imageWidth, integer $imageHeight ) : array Translate the textual position + offsets into x,y values.

Method Details

__construct() public method

Position constructor.
public __construct ( string $position = 'center', integer $offsetX, integer $offsetY )
$position string Defaults to center.
$offsetX integer Defaults to 0.
$offsetY integer Defaults to 0.

getOffsetX() public method

public getOffsetX ( ) : integer
return integer

getOffsetY() public method

public getOffsetY ( ) : integer
return integer

getText() public method

public getText ( ) : string
return string

getXY() public method

Translate the textual position + offsets into x,y values.
public getXY ( integer $canvasWidth, integer $canvasHeight, integer $imageWidth, integer $imageHeight ) : array
$canvasWidth integer Width of canvas.
$canvasHeight integer Height of canvas.
$imageWidth integer Width of image/object added.
$imageHeight integer Height of image/object added.
return array Array of X and Y coordinates: array($x, $y).