Label element (used with Interface module)
Description:
This element adds a text label to an interface. The font, size, color, border and background colours can all be customized, before or after adding the label to an interface.
To use:
The code for this element is included in the interface module, linked as follows:
<script language="Javascript" src="gamelib_interface.js"></script>
It's very easy to use this element; you just place it in the interface like so:
myLabel=new In_Label(10,20,200,50,'Some text!','center','#000000',3,'Arial','#0000ff','#aaaaaa');
myInterface.add(myLabel);
There are 11 parameters passed to this object. These are:
(1,2) x,y (position relative to interface top left corner)
(3,4) width,height
(5) text for the label,
(6) alignment of the text ('center'|'left'|'right') or if null, it will default to left
(7) color of label text
(8) font size for label (1-7)
(9) font face for label (if null, then Arial,Helvetica,sans-serif is used)
(10) border color (if null, there is no border OR background color)
(11) background color (if null, there is no background or border color)
Any of the properties for a label (excluding position) may be changed at any time.
List of methods for Label
setAlignment
setBackgroundColor
setBorderColor
setFontColor
setFontFace
setFontSize
setText
Descriptions of methods for Label