Can't compile haxeflixel to html5



  • Whenever I try to compile my haxeflixel projects to html5 I just get a page with a blank black rectangle. Can anyone tell me how to fix this? I started a completely new project using the getting started guide here: https://haxeflixel.com/documentation/getting-started/ I just added the hello world code given in the guide, then set the color of the text to white to make sure it would show up. These are my project files.

    AssetPaths.hx

    package;
    
    @:build(flixel.system.FlxAssets.buildFileReferences("assets", true))
    class AssetPaths {}
    

    Main.hx

    package;
    
    import flixel.FlxGame;
    import openfl.display.Sprite;
    
    class Main extends Sprite
    {
        public function new()
        {
    	    super();
    	    addChild(new FlxGame(0, 0, PlayState));
        }
    }
    

    PlayState.hx

    package;
    
    import flixel.FlxState;
    import flixel.text.FlxText;
    import flixel.util.FlxColor;
    
    class PlayState extends FlxState
    {
        override public function create():Void
        {
            super.create();
    
            var text = new flixel.text.FlxText(0, 0, 0, "Hello World", 64);
            text.color = FlxColor.WHITE;
            text.screenCenter();
            add(text);
        }
    
        override public function update(elapsed:Float):Void
        {
            super.update(elapsed);
        }
    }
    

    I've tried compiling both using the command line with the command "lime test html5" and by using Visual Studio Code. Here's a video of my problem. https://youtu.be/eDlrOyOAVNA

    Thanks.



  • Just tested the exact same code and it seems to work for me. Are you able to check if you have any errors in the browser console?

    Also, did you change anything int he Project.xml file?


Log in to reply
 

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.