Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update readme and addons.make in example

  • Loading branch information...
commit a3e91a549d61a4db360e0accfdbaa6281f057fd8 1 parent bbfa1d3
@elliotwoods authored
Showing with 46 additions and 6 deletions.
  1. +45 −3 README.md
  2. +1 −3 ofxAssets-example/addons.make
View
48 README.md
@@ -6,6 +6,48 @@ ofxAssets is an openFrameworks addon for simple access to assets inside your dat
## Usage
-```c+++
-//insert usage here
-```
+### Include source and headers
+Setup the addon with your project (e.g. drag the ofxAssets src files into your XCode project).
+
+### Put assets into an assets folder
+
+Assets go inside `data/assets`
+
+```
+appFolder/
+appFolder/data/assets/images - places images here (png, jpg, jpeg)
+appFolder/data/assets/shaders - place any shaders here (vert, frag, geom)
+appFolder/data/assets/fonts - place any font files here (ttf)
+```
+
+### Use ofxAssets in your code
+
+`header`
+```c++
+#include “ofxAssets.h”
+using namespace ofxAssets; // this is optional
+```
+
+`source`
+```c++
+//example
+void testApp::draw() {
+
+ // quick access to assets
+ image(“imageName”).draw(10,10);
+ font(“fontName”, 30).drawString(“...”, 10, 10);
+ shader(“shaderName”).begin();
+
+ // if you don’t put ‘using namespace ofxAssets’ at the top of your source or header, then use:
+ ofxAssets::image(“imageName”).draw(10,10);
+}
+```
+
+You can also reload the asset register (e.g. you edit an image externally and what to see it updated in your app) using
+
+```c++
+AssetRegister::refresh()
+```
+
+## Notes
+If your asset filename is like `background.png`, then you access this asset without the extension, e.g. `image(“background”).draw(10,10)`.
View
4 ofxAssets-example/addons.make
@@ -1,6 +1,4 @@
#This file is currently only for linux users!
#Add your addon and all other necessary ones here (without '#')
#put every addon in one line, for example
-#myAddon
-#ofxXmlSettings
-#ofxOpenCv
+ofxAssets
Please sign in to comment.
Something went wrong with that request. Please try again.