Wikitude ARchitect v2.0 API Documentation

Wikitude ARchitect > AR > Label
Filters

Class Label - extends Drawable2D

A Label drawable represents an ARObject as text.

The default anchor settings for a Label are as follows:
  • horizontal anchor: AR.CONST.HORIZONTAL_ANCHOR.CENTER
  • vertical anchor: AR.CONST.VERTICAL_ANCHOR.MIDDLE
On creation, setup parameters can be passed to customize the properties of the Label.

Example:
//create a new label and pass some setup parameters
var label = new AR.Label("", 20, {
  offsetY : 1,
  onClick : function() {
    label.text += "CLICK "
  },
  verticalAnchor : AR.CONST.VERTICAL_ANCHOR.TOP,
  opacity : 0.1
});

Constructor

Label ( text , height , options )
Parameters:
text <string> The text to be displayed on the Label.
height <float> The height of the Label, in SDUs
options <object> Setup-Parameters to customize additional object properties.

Accepted options-properties are
  • enabled
  • horizontalAnchor
  • verticalAnchor
  • offsetX
  • offsetY
  • zOrder
  • rotation
  • scale
  • opacity
  • onClick
  • style.backgroundColor
  • style.textColor
  • style.fontStyle
  • roll
  • tilt
  • heading

Properties

height - float

The height of the Label, in SDUs. Effectively, this will define the size of the Label.

style - {object}

The Style to be passed. Valid values are:
  • backgroundColor
  • textColor
  • fontStyle

text - string

The text of the label.

Methods inherited from Drawable2D:

Methods inherited from ARchitectObject:

Methods inherited from Drawable:


Copyright © 2013 Wikitude GmbH. All rights reserved.