November 25, 2020, 05:33:23 AM

Author Topic: [bmx] osx resource file locations by AdamStrange [ 1+ years ago ]  (Read 467 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
Title : osx resource file locations
Author : AdamStrange
Posted : 1+ years ago

Description : OSX stores everything in it's app file (which is really just a folder)
the structure is:
> contents
  > MacOS
  > resources

When developing, you will need to have all your files properly inside the app file to work. this is a bit of a pain with debug version, etc.

so here is some quick code that looks inside the app folder
then will look inside the home folder/resources/
then the home folder

So, during development you can just store everything in a folder called resources while developing and then move into the app when finished

Here we see then font folder version:

Code :
Code: BlitzMax
  1. Local FontDir:String = GetPreviousDir(GetPreviousDir(AppFile$) ) + "resources/font/"
  2. If FileType(FontDir) <> 2 Then FontDir = AppDir$ + "/resources/font/"
  3. If FileType(FontDir) <> 2 Then FontDir = AppDir$ + "/font/"
  4. Print "fontdir="+FontDir

Comments :

Brucey(Posted 1+ years ago)

 I generally just use a post build script (post.bmk) which does relevant stuff like copying resources and dylibs into the app bundle. Then everything is always in the correct place.Since my bmk_ng's scripting is lua-based, you can set it up to do quite complex stuff, all tied-in to the build system itself.


SimplePortal 2.3.6 © 2008-2014, SimplePortal