Wikitude ARchitect v2.0 API Documentation

Wikitude ARchitect > AR > ImageDrawable
Filters

Class ImageDrawable - extends Drawable2D

Known Subclasses:
AnimatedImageDrawable
ImageDrawable encapsulates an image to be used as visual representation of an ARObject.

If the image does not come in the appropriate size, the property can be used to scale it down. The default anchor settings for an ImageDrawable 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 ImageDrawable.

Example:
//create a new ImageDrawable from an ImageResource and pass some setup parameters
var imageDrawable = new AR.ImageDrawable(imageResource, 5, {
  offsetX : 1,
  rotation : 190
});

Constructor

ImageDrawable ( imageResource , height , options )
Parameters:
imageResource <ImageResource> The imageResource used for the ImageDrawable.
height <float> The height of the ImageDrawable, in SDUs. The width is set at creation time, width is calculated according to the aspect ratio of the underlying image.
options <object> Setup-Parameters to customize additional object properties.

Accepted options-properties are
  • enabled
  • horizontalAnchor
  • verticalAnchor
  • offsetX
  • offsetY
  • zOrder
  • rotation
  • scale
  • opacity
  • onClick
  • roll
  • tilt
  • heading

Properties

height - float The ImageDrawable's height in SDUs. The width of the ImageDrawable will be calculated accordingly based on the aspect ratio of the underlying Image.


imageResource - ImageResource

The imageResource representing the ImageDrawable.

Methods inherited from Drawable2D:

Methods inherited from ARchitectObject:

Methods inherited from Drawable:


Copyright © 2013 Wikitude GmbH. All rights reserved.