class WMLabel extends WMObjBase

Available on all platforms

Label object; a text

See WMBase and WMObjBase classes for inheritted parameters.

Instance Fields

var font:String

font name used for text. Default is "Arial"

var fontsize:Float

font size. default is 32.0

var opos:Point3D

original position; not intensively used.

var pos:Point3D

position of the text. no default.

var text:String

text to be shown. no default.

function new(r:Float, c0:Int, c1:Int, a:Float, o:Float, q:Int, ag:Float, d:Float, sp:Float, gl:Float, sh:String):Void

Constructor. Parameters are listed below, where values in parenthesis are default values.

  • r: width of the textfield (130.0)
  • c0: text color (0xFFFFFF, white)
  • c1: text color (0xFFFFFF, white), not used now
  • a: alpha (1.0, opaque)
  • o: offset (0)
  • q: quality (0), not used
  • ag: ambient intensity (0), not used
  • d: diffuse intensity (0), not used
  • sp: specular (0), not used
  • gl: gloss (20.0), not used
  • sh: shader type ("2DUV"), should not be changed

function absmax():Point3D

absolute max of position: max(abs(x),abs(y),abs(z))

function clear(def:WMDefaults):Void

initialize values; if def is given, that is used as initial value.

function clone():WMLabel

returns a copy of this instance

function gen(c:Context3D, is_dc_active:Bool):Void

generate polygon and set corresponding shaders; this function calls pregen and gen2.

function gen2(c:Context3D, is_dc_active:Bool):Void

generate polygon and shader. Call pregen function before. This function should not be called explicitly unless you are using multiple Workers.

function getDataSize():Int

predefined cost for drawing; returns always 3.

function get_font():String

getter for font

function get_fontsize():Float

getter for fontsize

function get_opos():Point3D

getter of opos

function get_pos():Point3D

getter of pos

function get_text():String

getter of text

function loadFromXml(x:Xml, def:WMDefaults):Void

load from XML; if def is given, that is used as initial value. See also clear function of this class.

function loadFromXmlOverwrite(x:Xml):Void

read XML while overriding default values; this function does not read WMAtom specific fields. Use loadFromXmlWOClear when loading WMAtom specific fields.

function loadFromXmlWOClear(x:Xml):Void

load XML data; usually this function is called by loadFromXml function

function num():Int

number of elements inside; return always 1.

function pregen():Void

preparation for generating polygon. This function is explicitly used in non-primordial Worker, where Context3D of the primordial Worker is not available. If Worker is not used, this function should not be called explicitly.

function scaleCoord(scale:Float):Void

scale position by scale

function set_font(fn:String):String

setter for font

function set_fontsize(fs:Float):Float

setter for fontsize

function set_opos(p:Point3D):Point3D

setter of opos

function set_pos(p:Point3D):Point3D

setter of pos

function set_text(t:String):String

setter of text

function sumPos():Point3D

sum of position

function translate(p:Point3D):Void

translate coordinate by p