fixed bootstrapping and asset handling
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
package;
|
||||
|
||||
import openfl.utils.AssetType;
|
||||
import openfl.display.Sprite;
|
||||
import openfl.Assets;
|
||||
import openfl.Lib;
|
||||
import sys.FileSystem;
|
||||
import Assets;
|
||||
|
||||
class Main extends Sprite {
|
||||
public function new() {
|
||||
super();
|
||||
|
||||
|
||||
Lib.current.addChild(this);
|
||||
|
||||
// Draw background to verify app is running
|
||||
graphics.beginFill(0x3498db, 1);
|
||||
graphics.drawRect(0, 0, 800, 600);
|
||||
graphics.endFill();
|
||||
|
||||
var testAsset = Assets.getText("assets/data/img/placeholder.txt");
|
||||
trace(testAsset);
|
||||
|
||||
var testAsset = openfl.Assets.getText("img/placeholder.txt");
|
||||
trace("Successfully loaded asset: " + testAsset);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user