ManiaLib 1.0b1 API Reference

Abstract Class GuiElement

Description

Base class for creating GUI elements

  • abstract:

Located in /gui-toolkit/standard.php (line 173)

GuiComponent
   |
   --GuiElement
Direct descendents
Class Description
 class Spacer A blank element, useful to place gaps between elements when using layouts
 class Quad Quad
 class IncludeManialink Include
 class Format Format
 class Music Music
Class Constant Summary
Method Summary
 GuiElement __construct ([float $sizeX = 20], [float $sizeY = 20])
 void addLink (GuiElement $object)
 void addPlayerId ()
 int getAction ()
 int getActionKey ()
 boolean getAddPlayerId ()
 string getBgcolor ()
 string getHalign ()
 string getImage ()
 string getImageFocus ()
 void getImageFocusid ()
 void getImageid ()
 string getManialink ()
 string getManiazone ()
 string getStyle ()
 string getSubStyle ()
 string getUrl ()
 string getValign ()
 string hasLink ()
 void save ()
 void setAction (int $action)
 void setActionKey (int $actionKey)
 void setAlign ([string $halign = null], [string $valign = null])
 void setBgcolor (string $bgcolor)
 void setHalign (string $halign)
 void setImage (string $image, [string $absoluteUrl = APP_IMAGE_DIR_URL])
 void setImageFocus (string $imageFocus, [string $absoluteUrl = APP_IMAGE_DIR_URL])
 void setImageFocusid ( $imageFocusid)
 void setImageid ( $imageid)
 void setManialink (string $manialink)
 void setManiazone (string $maniazone)
 void setStyle (string $style)
 void setSubStyle (string $substyle)
 void setUrl (string $url)
 void setValign (string $valign)
Methods
Constructor __construct (line 206)

Manialink element default constructor. It's common to specify the size of the element in the constructor.

GuiElement __construct ([float $sizeX = 20], [float $sizeY = 20])
  • float $sizeX: Width of the element
  • float $sizeY: Height of the element

Redefined in descendants as:
addLink (line 523)

Imports links and actions from another Manialink element

void addLink (GuiElement $object)
addPlayerId (line 297)

Adds the player information parameters ("playerlogin", "nickname",

"path", "lang") to the URL when you click on the link

void addPlayerId ()
getAction (line 458)

Returns the action associated to the element

int getAction ()
getActionKey (line 467)

Returns the action key associated to the element

int getActionKey ()
getAddPlayerId (line 477)

Returns whether the elements adds player information parameter to the URL

when it's clicked

boolean getAddPlayerId ()
getBgcolor (line 486)

Returns the background color of the element

  • return: 3-digit RGB hexadecimal value
string getBgcolor ()
getHalign (line 413)

Returns the horizontal alignment of the element

string getHalign ()
getImage (line 495)

Returns the image placed in the element

  • return: The image URL
string getImage ()
getImageFocus (line 509)

Returns the image placed in the element in its highlighted state

  • return: The image URL
string getImageFocus ()
getImageFocusid (line 514)
void getImageFocusid ()
getImageid (line 500)
void getImageid ()
getManialink (line 431)

Returns the Manialink hyperlink of the element

string getManialink ()
getManiazone (line 440)

Returns the Maniazones hyperlink of the element

string getManiazone ()
getStyle (line 395)

Returns the style of the element

string getStyle ()
getSubStyle (line 404)

Returns the substyle of the element

string getSubStyle ()
getUrl (line 449)

Returns the hyperlink of the element

string getUrl ()
getValign (line 422)

Returns the vertical alignment of the element

string getValign ()
hasLink (line 541)

Returns whether the object has a link or an action (either Manialink,

Maniazones link, hyperlink or action)

string hasLink ()
save (line 571)

Saves the object in the Manialink object stack for further rendering.

Thanks to the use of GuiElement::preFilter() and GuiElement:: postFilter(), you shouldn't have to override this method

void save ()
setAction (line 307)

Sets the action of the element. For example, if you use the action "0" in the explorer, it closes the explorer when you click on the element.

void setAction (int $action)
  • int $action
setActionKey (line 317)

Sets the action key associated to the element. Only works on dedicated servers.

void setActionKey (int $actionKey)
  • int $actionKey
setAlign (line 259)

Sets the alignment of the element

void setAlign ([string $halign = null], [string $valign = null])
  • string $halign: Horizontal alignement can be eithe "left", "center" or "right"
  • string $valign: Vertical alignment can be either "top", "center" or "bottom"
setBgcolor (line 327)

Sets the background color of the element using a 3-digit RGB hexadecimal

value. For example, "fff" is white and "000" is black

void setBgcolor (string $bgcolor)
  • string $bgcolor: 3-digit RGB hexadecimal value
setHalign (line 247)

Sets the horizontal alignment of the element

void setHalign (string $halign)
  • string $halign: Horizontal alignement can be eithe "left", "center" or "right"
setImage (line 340)

Applies an image to the element. If you don't specify the second

parameter, it will look for the image in the path defined by the APP_IMAGE_DIR_URL constant

void setImage (string $image, [string $absoluteUrl = APP_IMAGE_DIR_URL])
  • string $image: The image filename (or URL)
  • string $absoluteUrl: The URL that will be appended to the image. Use null if you want to specify an absolute URL as first parameter
setImageFocus (line 371)

Applies an image to the highlighter state of the element. The second

parameter works just like GuiElement::setImage()

void setImageFocus (string $imageFocus, [string $absoluteUrl = APP_IMAGE_DIR_URL])
  • string $imageFocus: The image filename (or URL)
  • string $absoluteUrl: The URL that will be appended to the image. Use null if you want to specify an absolute URL as first parameter
setImageFocusid (line 386)

Set the image focus id of the element, used for internationalization

void setImageFocusid ( $imageFocusid)
  • $imageFocusid
setImageid (line 357)

Set the image id of the element, used for internationalization

void setImageid ( $imageid)
  • $imageid
setManialink (line 270)

Sets the Manialink of the element. It works as a hyperlink.

void setManialink (string $manialink)
  • string $manialink: Can be either a short Manialink or an URL pointing to a Manialink
setManiazone (line 288)

Sets the Maniazones link of the element

void setManiazone (string $maniazone)
  • string $maniazone
setStyle (line 217)

Sets the style of the element. See http://fish.stabb.de/styles/ of the manialink 'example' for more information on Manialink styles.

void setStyle (string $style)
  • string $style
setSubStyle (line 227)

Sets the sub-style of the element. See http://fish.stabb.de/styles/ of the manialink 'example' for more information on Manialink styles.

void setSubStyle (string $substyle)
  • string $substyle
setUrl (line 279)

Sets the hyperlink of the element

void setUrl (string $url)
  • string $url: An URL
setValign (line 237)

Sets the vertical alignment of the element.

void setValign (string $valign)
  • string $valign: Vertical alignment can be either "top", "center" or "bottom"

Inherited Methods

Inherited From GuiComponent

 GuiComponent::getPosX()
 GuiComponent::getPosY()
 GuiComponent::getPosZ()
 GuiComponent::getScale()
 GuiComponent::getSizeX()
 GuiComponent::getSizeY()
 GuiComponent::setPosition()
 GuiComponent::setPositionX()
 GuiComponent::setPositionY()
 GuiComponent::setPositionZ()
 GuiComponent::setScale()
 GuiComponent::setSize()
 GuiComponent::setSizeX()
 GuiComponent::setSizeY()
Class Constants
USE_ABSOLUTE_URL = null (line 175)