I tried to put in the HTMLDrawable into Simple IR Example project. But it not work!! Why? I put in the others drawable and it is ok. Please help! I don't need the point of interest, only Image Recognition. Thanks.
W
Wolfgang Damm
said
about 11 years ago
HTMLDrawables do not depend on IR or Geo, they should work with both. Did you check that your Javascript runs correctly using the ADE (Archtiect desktop engine)?
J
Jonathan Ho
said
about 11 years ago
Yes, I tried running in the ADE and it runs properly. But after compile it new and run the apk in the Android phone it cannot show the html. I put here the modified Simple IR code with the HTMLDrawable inside.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta name="viewport" content="target-densitydpi=device-dpi, width = 540, user-scalable = 0" /> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>SGI Demo</title>
function errorTracker() { errorOccured = true; document.getElementById("messageElement").innerHTML = "Unable to load image or tracker!"; }
function createTracker(){ //create a new html drawable and pass some setup parameters to it htmlLarge = new AR.HtmlDrawable({ html:"<h1 style='color:red'>red orb</h1>" }, 4, { viewportWidth: 512, scale:1, updateRate:AR.HtmlDrawable.UPDATE_RATE.HIGH, onLoaded : htmlLoaded, onError: errorHTML });
It's there ;), you'll just have to look at it from far away.
What's happenign is that you defined the size to 4 which is 4 times the height of the image target. Your text is just drawn to the left of this and therefore won't be visible when normally viewed.
Jonathan Ho