initialize standalone OpenFL application structure with essential files and configurations
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package;
|
||||
|
||||
import openfl.display.BitmapData;
|
||||
import openfl.media.Sound;
|
||||
import openfl.text.Font;
|
||||
import openfl.utils.ByteArray;
|
||||
|
||||
@:build(macros.AssetMacro.buildAssets())
|
||||
class Assets {
|
||||
// The @:build macro will inject the initializeAssets method
|
||||
|
||||
// Helper methods for convenience
|
||||
public static function getBitmapData(id:String):BitmapData {
|
||||
return openfl.Assets.getBitmapData(id);
|
||||
}
|
||||
|
||||
public static function getSound(id:String):Sound {
|
||||
return openfl.Assets.getSound(id);
|
||||
}
|
||||
|
||||
public static function getFont(id:String):Font {
|
||||
return openfl.Assets.getFont(id);
|
||||
}
|
||||
|
||||
public static function getText(id:String):String {
|
||||
return openfl.Assets.getText(id);
|
||||
}
|
||||
|
||||
public static function getBytes(id:String):ByteArray {
|
||||
return openfl.Assets.getBytes(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user