Skip to content

Instantly share code, notes, and snippets.

@nitrobin
Created June 19, 2014 04:03
Show Gist options
  • Save nitrobin/de3dabeff3a05df05aad to your computer and use it in GitHub Desktop.
Save nitrobin/de3dabeff3a05df05aad to your computer and use it in GitHub Desktop.
Consts for all assets IDs (openfl template).
package;
// Consts for all assets IDs (openfl template).
// Copy to '%PROJECT_DIR%/templates/haxe/AssetId.hx'
// Add entry '<template path="templates"/>' to 'project.xml'
// Add "%EXPORT_DIR%/flash/haxe" as sources dir for IDE code completion
// Using in code: openfl.Assets.getText(AssetId.assets_data_txt)
// openfl.Assets.getBitmapData(AssetId.images_logo_png)
class AssetId {
// Auto-generated content begin:
::if (assets != null)::::foreach assets::public static inline var ::flatName:: = "::id::";
::end::::end::
public static function getAllIds(){
return [
::if (assets != null)::::foreach assets::::flatName::,
::end::::end::
];
}
// Auto-generated content end;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment