I am trying to load an image as a marker that is included within the project in a sub folder given a path: "folder/folder/image.jpg". The only images that seem to be loading are ones included in within the main bundle and are located with in the root directory of the xcode project.
A use case for this would be if I wanted to use an image from the users camera as a marker. Is this a possibility with the SDK?
A
Andreas Schacherbauer
said
almost 10 years ago
Hi,
Have you added the folders which contain the images as a group or a folder reference (yellow or blue icon)? Depending on that, the path for local resources changes. Yellow groups are accessable as if they are in the root folder of the bundle. Blue folder references structures are copied exactly into the app bundle.
Group example:
/folder/to/my/image.png => var image = new AR.ImageResource("image.png");
Reference example:
/folder/to/my/image.png => var image = new AR.ImageResource("folder/to/my/image.png");
You can also find more information about that topic in the SDK documentation.
Best regards
Andreas
A
Aaron Rivera
said
almost 10 years ago
Hey Andreas, Thanks for the reply! That does help. Will this also allow me to use a users custom image say in the "Documents" folder of the app?
A
Andreas Schacherbauer
said
almost 10 years ago
Hi,
You need to get the path of specific folders/images from within the app bundle in ObjC and then inject the path into JavaScript. To pass the path into JS, use the - method.
Aaron Rivera