braitsch / ofxDatGui

Simple to use, fully customizable, high-resolution graphical user interface for openFrameworks
https://braitsch.github.io/ofxDatGui/
Other
432 stars 113 forks source link

Empty interface when moving app #65

Closed vibber closed 8 years ago

vibber commented 8 years ago

Thanx for creating this beautiful gui. My problem: I built as Release. Moved the app to a USB stick / another computer including the data folder next to the app. When i run the app I get a blank gui with no text or sliders. Can you help? Am I building it wrong? skaermbillede 2016-04-14 kl 14 40 03 skaermbillede 2016-04-14 kl 14 40 17

(Xcode 7.2.1)

vibber commented 8 years ago

If I copy the whole Openframeworks folder over, then everything looks right. So what can it be missing? As you see I did include the ofxbraitsch folder.

vibber commented 8 years ago

Found the solution after some digging: Right after creating the ofxDatGui, I insert this line: gui->setAssetPath(""); This resets the location to search for the ofxbraitsch folder (the one in the data directory) instead of looking for it in the addons folder of openframeworks.

asaeed commented 8 years ago

On Windows 10, oF 0.9.3, it only seems to work if i insert that line BEFORE instantiating the datgui object: gui->setAssetPath(""); gui = new ofxDatGui(0, 0);

batchku commented 7 years ago

@braitsch I'm still having the same issue here; i'm building a Release on os X with Xcode and the binary only shows the gui if it's within the openFrameworks folder; when i move it to the Applications folder, i have no text.

I've tried putting the .ttf in every part of the application package, but it still doesn't seem to find it.

I have confirmed the the Release App shows text properly if it's sitting next to a folder called 'data' that has the .ttf in it. Oddly, all of the same contents are inside of the Application Package, including the font; but the App doesn't appear to see it.

I have also tried putting gui->setAssetPath(""); after the ofxDatGUI is created; this doesn't solve my problem.

what am i doing wrong? where exactly in the application package should the .ttf go?

braitsch commented 7 years ago

You have to tell Xcode to bundle the resources in /bin/data into your release build. https://stackoverflow.com/a/17159123/228315

batchku commented 7 years ago

I have done this, but I still have the same problem of fonts not getting found. Here is the run script:

image

Here is the line of code i've added to ofApp.cpp's setup() routine:

ofSetDataPathRoot("../Resources/data/");

Here is how i'm trying to load the font:

ofTrueTypeFont verdana;
verdana.load("Verdana.ttf", 12);

And here is where the .tff file is in my data folder: image

I can confirm that the data folder IS finding its way into the application package: image

What am I doing wrong?

P-v-K commented 5 years ago

@batchku Did you ever sort this out? I am trying to use ofxDatGui on Android now, and currently seeing my fonts sometimes not get loaded in it. No idea why or how to fix it.