PHP Class Grafika\Position

Afficher le fichier Open project: kosinix/grafika Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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 méthode

public getOffsetX ( ) : integer
Résultat integer

getOffsetY() public méthode

public getOffsetY ( ) : integer
Résultat integer

getText() public méthode

public getText ( ) : string
Résultat string

getXY() public méthode

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.
Résultat array Array of X and Y coordinates: array($x, $y).