I want to overlay some text over a marker, ex: text "pub" over marker1.png
// Create new images, which will be loaded right away
firstImage = new AR.ImageResource("marker1.png", {onError: errorLoadingImage});
A
Andreas Fötschl
said
over 10 years ago
Hi there!
Please have a look at GeoObjects reference doc. OffsetX, OffsetY and renderingOrder should help you making this possible.
I copy-pasted some lines from the simpleARBrowser (all data is just dummy and needs your review)
var poidrawables = new Array();
var imageRes = new AR.ImageResource("YOUR.png"); var drawable = new AR.ImageDrawable(imageRes, 2.0); var label = new AR.Label("foobar",1.0, {offsetY : -1.5, style : {textColor : '#00C100',backgroundColor : '#FFFFFF80'}});
poidrawables.push(label);
poidrawables.push(drawable);
var geoLoc = new AR.GeoLocation(12.2 ,13.3, 100); var yourGeoObj = new AR.GeoObject(geoLoc, {drawables: {cam: poidrawables}});
Please have a look at the *.html" inside the SimpleARBrowser example provided inside the Android/iOS SDK to see a working sample.
Rasanga Perera