Skip to content

Commit

Permalink
update readme and addons.make in example
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotwoods committed Aug 30, 2012
1 parent bbfa1d3 commit a3e91a5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
48 changes: 45 additions & 3 deletions README.md
Expand Up @@ -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)`.
4 changes: 1 addition & 3 deletions 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

0 comments on commit a3e91a5

Please sign in to comment.