# Class: Label

### LuxModule: gui

A Label element for displaying only.

## Hierarchy

    o-+ Component
      o-+ Label
        o-- MultiLineLabel

## Methods:

### Method overview:

- LABEL_ALIGNCENTERED
- LABEL_ALIGNLEFT
- LABEL_ALIGNRIGHT
- createVisibles
- deleteVisibles
- getAlignment
- getText
- isFocusable
- mouseClicked
- new
- onGainedFocus
- onTextChange
- positionUpdate
- setAlignment
- setText
- toString

new (class, int x,y,w,h, text, [align, [autofocus] ])
  returns: (Label)
  creates a labelwith the given dimensions. The align value can be a constant from the Label table (Label_ALIGNRIGHT, ...).
LABEL_ALIGNCENTERED
  [int] - constant for centered text alignment
LABEL_ALIGNLEFT
  [int] - constant for left text alignment
LABEL_ALIGNRIGHT
  [int] - constant for right text alignment
createVisibles (Component self,l2dnode basel2d)
  returns: ()

  description from overloaded method of Component:

  called when a Component is now displayable (doesn't have to be visible)
deleteVisibles (Component self)
  returns: ()

  description from overloaded method of Component:

  called when a Component is no longer displayed
getAlignment (Label)
  returns: (string alignment)
  returns current alignment of the label's text
getText (Label)
  returns: (string)
  returns the string label
isFocusable (Label)
  returns: (boolean)
  returns true if visible
mouseClicked (Component self, MouseEvent e, boolean mouseover)
  returns: ()

  description from overloaded method of Component:

  called if the mouse was clicked on the component.
onGainedFocus (from)
  returns: ()
  simply forwards the focus to the next element.
onTextChange (Label)
  returns: ()
  called if the text changed (ie. by user input)
positionUpdate (Component self,int zindex,Rectangle clip)
  returns: (int newz)

  description from overloaded method of Component:

  called when the component was moved or resized. Overload this method for visual appearance. The zindex is the id to use for zordering the components. Return the newz value, reserving all the values that you require for your visual nodes.
setAlignment (Label,[alignment])
  returns: ()
  sets textalignment, or resets to default (left aligned)
setText (Label,string)
  returns: ()
  sets the label's text
toString (Label)
  returns: (string)
  returns simple component representation

## Inherited Methods:

### From Component

acceptSkinBounds, addKeyListener, addMouseListener, clipinsets, colors, contains, createVisibles, delete, deleteVisibles, focus, focuscolors, getBounds, getClipRect, getFocusComponentAt, getFocusElement, getFocusIndex, getHeight, getLocation, getMinSize, getMouseLock, getParent, getSize, getSkin, getWidth, getX, getY, hasFocus, hideVisibles, index, invalidate, isClipped, isDisplayedFlag, isFocusable, isMouseLocker, isVisible, isVisibleFlag, keyEvent, keylisteners, local2world, lockMouse, mouseClicked, mouseEntered, mouseEvent, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheeled, mouselisteners, moveToRect, new, newFocusOrder, onDestroy, onDisplayChange, onGainedFocus, onLostFocus, onVisibilityChange, positionUpdate, remove, removeKeyListener, removeMouseListener, setBounds, setClip, setColor, setDisplayable, setFont, setLocation, setSize, setSkin, setVisibility, showVisibles, skinnames.defaultskin, skinnames.focusedskin, skinnames.hoveredskin, skinnames.pressedskin, think, toString, transferFocus, transferFocusOnArrows, transferFocusOnTab, unlockMouse, updateSkin, validate, white, world2local, zorderoffset