Start a new topic

Change anchor point of drawable?

Is there a way to change the anchor point of a drawable from the center to the bottom?

1 Comment

Hi Joe,



yes there is. Only for 2D drawables though, not for 3D models.


var overlayOne = new AR.ImageDrawable(imgOne, 1, {

    horizontalAnchor: AR.CONST.HORIZONTAL_ANCHOR.LEFT,

    verticalAnchor: AR.CONST.VERTICAL_ANCHOR.BOTTOM,

});


This will move the origin from the center to the bottom left. 


Valid values for the vertical anchor position are {AR.CONST.VERTICAL_ANCHOR.TOP, AR.CONST.VERTICAL_ANCHOR.MIDDLE, AR.CONST.VERTICAL_ANCHOR.BOTTOM}, valid values for the horizontal anchor position are {AR.CONST.HORIZONTAL_ANCHOR.LEFT, AR.CONST.HORIZONTAL_ANCHOR.CENTER, AR.CONST.HORIZONTAL_ANCHOR.RIGHT}.



- Daniel

Login or Signup to post a comment