We have launched beta versions of OpenFL on NPM, and are rapidly approaching things being stable. Some of you who have been here a while may ask, how does it work? What is it? How it different than the past releases?
However, support for NPM (and support for Haxelib) does not require a separate codebase.
There are many tools that already exist for web developers, including Webpack. In our samples, we have been using Webpack and there some fun features that have come out of the box. All of our samples use the Webpack development server for testing, which includes “hot reloading.” When you make source code changes and save your file, the project recompiles, and the test browser window reloads. This even works for SWF assets now
We also going to be able to do interactive demonstrations of OpenFL more easily, as well as many other benefits from increased testing of the codebase.
We will continue to release OpenFL for Haxelib, while also producing OpenFL releases for NPM. The Lime API is currently not available on NPM, nor are the tools, but there are other little features that are nice for quickly making OpenFL content available on the web.
var sprite = new openfl.display.Sprite (); sprite.graphics.beginFill (0xFF0000); sprite.graphics.drawRect (0, 0, 100, 100); var stage = new openfl.display.Stage (550, 400); stage.addChild (sprite); document.body.appendChild (stage.element);
You can create use the Yeoman generator for OpenFL to create new working projects:
npm install -g yo generator-openfl
mkdir NewProject cd NewProject yo openfl
We also have many samples available:
Please feel free to ask questions, and remember that we are still committed to existing platforms. The NPM approach is a new exciting way to use OpenFL in more projects