Start a new topic

Uri of htmldrawble

Uri of htmldrawble


I have a question about a file for the following statement:
var img = new AR.HtmlDrawable({uri: fogliohtml}, 4, {viewportWidth: 512, scale:1, updateRate:AR.HtmlDrawable.

UPDATE_RATE.STATIC})






the variable 'fogliohtml' has to read in folder 'Documents' of my App iPad and iPhone.
How can I write it ? I try to write /MyApp/Documents/name of the html but doesn't function.
Thank you


You have to use an URL starting with file://. I suggest using a relativ URL. If you must access it via an absolute URL you need to use Objective C.

1. relative URL
e.g. if the fogliohtml is relative to your World's main html file. just use the relative path.

2. URL via Objective C (not recommended!)
Bit trickier as your app's file path might change between different App installs. Therefore you have to query the path to your file and make an URL out of it. This URL needs to be passed to your World e.g. by calling a javascript method via passing the URL as parameter.



 

Note: If you have switched to the 3.1 SDK please review the changed HtmlDrawable API. update rate is no longer needed and a viewportHeight needs to be defined. I suggest updating as the HtmlDrawable implementation has been reworked to improve its performance.
Login or Signup to post a comment