Crate pxl_build[][src]


A compile time resource-loader for pxl.

To use, add pxl-build to your build-dependencies, put all the resources you would like to use in your pxl program in a directory named resources in the root of your crate, and put the following into a file named, also in the root of your crate:

extern crate pxl_build;

fn main() -> Result<(), pxl_build::Error> {

Then, in your program, you can do:

β“˜This example is not tested
extern crate pxl;

include!(concat!(env!("OUT_DIR"), "/"));

Your resources will be available as statics with uppercase names derived from their filenames, in modules according to the structure of the resources folder.

For example, if you put an image into resources/images/player.png, it will be available in your program as images::PLAYER.



Build errors



Compile the resources in resource_directory into $OUT_DIR/ for inclusion in a pxl program.