Start a new topic

More then one Line in a AR.Label

More then one Line in a AR.Label

Is there a way to have more then one Line in a AR.Label?
I have long names for the POI's from a DB. If they are on one Line the screen get crowded.
I tried something like var text = "a very long namengives me problems".
But that did give me some squeres in the Label. Also \r did not work.
Is there a solution?
Can i provide 2 labels for one POI?
The AR.Label is for single lines only. If you want to display multiple lines for a POI you can create 2 AR.Labels and attach both to the AR.GeoObject.

e.g.
var drawables = new Array();
drawables.push(new AR.Label("1st line", 1, {offsetY: 0}));
drawables.push(new AR.Label("2nd line", 1, {offsetY: 1}));

new AR.GeoObject(geoLocation, {drawables: {cam: drawables}});
Thanks a lot. This works well.

Hii

I want to display many labels around an image on image recognition so i m using 

this.tracker = new AR.ClientTracker("assets/magazine.wtc", {

 

onLoaded: this.worldLoaded

 

});

 

 

var overlay = new Array();

            overlay.push(new AR.Label("Temperature",0.03, {offsetY : -0.5, style : {textColor : '#00C100',backgroundColor : '#FFFFFF80'}}));

            overlay.push(new AR.Label("Humidity",0.03, {offsetY : 0.5, style : {textColor : '#00C100',backgroundColor : '#FFFFFF80'}}));

 

var trackable = new AR.Trackable2DObject(this.tracker, "*", {

drawables: {

cam:

}

});

Is this the right way?please suggest 

Yes, that's the right way.
Note that you may create a picture of your text and use AR.ImageDrawables instead in order to ensure your augmentation looks the very same on Android and iOS. Also check your height value, it may be quite small (depending on the target's real size)
Login or Signup to post a comment