grumpytoad / Canvas/NME (http://flashsandy.org/haxe)

A re-implementation of NME for use with the HTML5 canvas element on the javascript target. Currently implemented against Neash, and being developed alongside the Sandy 3D haXe engine.

Clone this repository (size: 107.4 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/grumpytoad/canvas-nme/

== Welcome ==

Canvas-NME is currently under much development, bug reports are very appreciated. The current focus of development is integration with the Neash library, using Sandy-hx as a basis for testing. Here are some links:

- A demo of this library - The Sandy haXe page - The Neash/NME Google page

To use this library, you will need to checkout the Neash Subversion trunk repository:

svn co https://neash.googlecode.com/svn

Then clone the canvas-nme library using mercurial:

hg clone http://bitbucket.org/grumpytoad/canvas-nme/

You can then program in haXe using the flash API, but targeting the javascript platform. You will need to modify your hxml build file to look similar to the following:

-cp path/to/neash
-cp path/to/canvas
--remap flash:neash
-js test.js
-main Test

In the main function of the Test class you will need to bootstrap the neash library.

1
2
3
4
5
6
static function main () {
#if (js || neko || cpp)
  neash.Lib.Init("Container", 400, 400);
  neash.Lib.Run();
#end
}

In the HTML file you will need a canvas HTML tag, with the id attribute set to the string specified in the bootstrap code:

1
2
<canvas id="Container" width="400" height="400"></canvas>
<script type="text/javascript" src="test.js"></script>

More comprehensive examples will be available on the Sandy haXe page as a download of tutorials, and/or in the neash-samples directory.


This revision is from 2008-12-05 12:23