Created
February 24, 2016 11:10
-
-
Save AxGord/ce5c654b18e19a8edbb8 to your computer and use it in GitHub Desktop.
Asset managet example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ParentClass | |
* @author AxGord <[email protected]> | |
*/ | |
@:assets_path('assets') | |
class ParentClass implements HasAsset { | |
@:asset public static var MY_ASSET = 'myasset3.png'; | |
static function main() { | |
ParentClass.loadAllAssets(function(current:Int, total:Int) trace(current, total)); | |
} | |
} | |
/** | |
* Child | |
* @author AxGord <[email protected]> | |
*/ | |
@:assets_parent(ParentClass) | |
@:assets_path('example') | |
class Child implements HasAsset { | |
@:asset public static var MY_ASSET = 'myasset.png'; | |
@:asset public static var MY_ASSET2 = 'myasset2.png'; | |
@:asset('tile1.png') public static var MY_TILE1 = 'basetile.png'; | |
@:asset('tile2.png') public static var MY_TILE2 = 'basetile.png'; | |
@:asset('Font name') public static var MY_FONT = 'myfont.fnt'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment