Reputation: 801
I am trying to use the trace method to print a string on the screen. I thought that Haxe code should work in Flambe, but apparently it doesn't. I tried to run this code but all I get is a black screen:
package urgame;
class Main {
static public function main():Void {
trace("Hello World");
}
}
I took the code from this haxe guide.
I also tried to use this code but the result is identical (black screen):
package urgame;
import flambe.Entity;
import flambe.System;
import flambe.asset.AssetPack;
import flambe.asset.Manifest;
import flambe.display.FillSprite;
import flambe.display.ImageSprite;
import flambe.display.Sprite;
class Main
{
private static function main ()
{
// Wind up all platform-specific stuff
System.init();
// Load up the compiled pack in the assets directory named "bootstrap"
var manifest = Manifest.fromAssets("bootstrap");
var loader = System.loadAssetPack(manifest);
loader.get(onSuccess);
}
private static function onSuccess (pack :AssetPack)
{
trace('Hello World');
}
Upvotes: 1
Views: 77
Reputation: 10143
If you run the html version the traces should be displayed in the browser console. So do build and run (debug build) and hit F12 in the browser.
Upvotes: 1