How do you maintain image source reference on multiple platforms?

Devin Asay devin_asay at byu.edu
Tue Nov 1 12:21:19 EDT 2016


> On Nov 1, 2016, at 9:28 AM, Tore Nilsen <tore.nilsen at me.com> wrote:
> 
> You should probably use the specialFolderPath(“resources”) to set the relative path to your images. This should work on all systems.

+1 In the development environment this function returns the path to the folder where your stack resides. In a standalone it should be the folder where all files copied in the Standalone Builder reside. On mobile platforms it is the same as specialFolderPath(“engine”), the place where the standalone bundle resides, and the place where resources copied at build time reside.

Devin

> 
> Tore
>> 1. nov. 2016 kl. 15.11 skrev Tiemo Hollmann TB <toolbook at kestner.de>:
>> 
>> Hello,
>> 
>> 
>> 
>> after I got the trick on how to handle multiple image sources for  different
>> screen resolutions, I began changing all images in my programs from imported
>> images to external references. I created on my development platform windows
>> a "resource" folder under my development folder, referenced my images to
>> that folder, added all image files to the standalone setting "copy files"
>> and set the destination folder for the copy files in the standalone setting
>> also to a folder "resources". So far, that works fine now.
>> 
>> 
>> 
>> On windows I only create the windows standalone. For the final tests,
>> adaptions and creating the standalone for Mac OS, I copy the source stack to
>> my Mac. Here comes my issue. All of my images have a windows path as source
>> reference, like "C:/myPath/recsources/myImage.png", which obviously doesn't
>> work on Mac. I tried to set the image source path to a relative path like
>> "/resources/myImage.png", hoping that would catch the image on both
>> platforms, but obviously relative paths are not working as image source.
>> This would be a clean solution for this issue.
>> 
>> 
>> 
>> Since the transport of the source stacks is not a one time thing, but can be
>> made quite often in the last steps of the project (to always keep the master
>> source on my main dev platform windows), it actually can't be it to change
>> manually all image paths each time after moving the stack from one platform
>> to the other. Do I oversee anything here, or is the only solution to write a
>> script, which runs thru all objects and converts the image paths each time I
>> transfer my stacks? If yes, has anybody such a small tool? I fear, I am the
>> only one, who is developing on two platforms, otherwise this must have come
>> up earlier.
>> 
>> 
>> 
>> How do you handle this? Any recommendations welcome
>> 
>> Tiemo
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

Devin Asay
Director
Office of Digital Humanities
Brigham Young University



More information about the Use-livecode mailing list