ManiaLib 1.0b1 API Reference

Abstract Class GuiTools

Description

GUI Tools

Misc helpers for the GUI toolkit

  • abstract:

Located in /gui-toolkit/GuiTools.class.php (line 14)


	
			
Method Summary
 static array getAlignedPos (GuiElement $object, string $newHalign, string $newValign)
 static int getAlignedPosX (int $posX, int $sizeX, string $halign, string $newAlign)
 static int getAlignedPosY (int $posY, int $sizeY, string $valign, string $newAlign)
Methods
static getAlignedPos (line 111)

Returns the position of an element in relation to another element and according to their respective alignments

  • return: Calculated position of the element you want to place. The array contains 2 elements with "x" and "y" indexes
  • access: public
array getAlignedPos (GuiElement $object, string $newHalign, string $newValign)
  • GuiElement $object: Parent element
  • string $newHalign: Horizontal alignement of the element you want to place
  • string $newValign: Vertical alignement of the element you want to place
static getAlignedPosX (line 26)

Returns the X position of an element in relation to another element and according to their respective alignments

  • return: Calculated X position of the element you want to place
  • access: public
int getAlignedPosX (int $posX, int $sizeX, string $halign, string $newAlign)
  • int $posX: X position of the parent element
  • int $sizeX: Width of the parent element
  • string $halign: Horizontal alignement of the parent element
  • string $newAlign: Horizontal alignement of the element you want to place
static getAlignedPosY (line 75)

Returns the Y position of an element in relation to another element and according to their respective alignments

  • return: Calculated Y position of the element you want to place
  • access: public
int getAlignedPosY (int $posY, int $sizeY, string $valign, string $newAlign)
  • int $posY: Y position of the parent element
  • int $sizeY: Height of the parent element
  • string $valign: Vertical alignement of the parent element
  • string $newAlign: Vertical alignement of the element you want to place