Skip to content

c-g-dev/heaps-local-res

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heaps Local Resources

Split up your Heaps.io resources so they don't all have to be dumped into the same /res folder at the root of the project.

  • Have multiple /res folders.
  • Have /res folders scoped to individual packages so that resouces can colocate with their relevant code.

Example structure:

/res
/src
    /subfolder
        /res
        EncapsulatedComponent.hx
    GlobalComponent.hx
class EncapsulatedComponent extends Bitmap {
    public function new() {
        super();
        var localRes = LocalRes.here(); //macro function loads resources in this modules directory
        this.tile = localRes.res("sometile.png").toTile(); //call .res(<filename>) to get the resource from the /res folder in this class file's direcoty
    }
}

About

Use macros to split up your Heaps resource folder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published