Plustd is a Haxe library in development, aimed at 2D game development, interactive apps, and more - performance-oriented while supporting many platforms.
Currently, it supports:
- Flash
- Javascript / Canvas
- C++ / SDL / Desktop (OS X)
- C++ / SDL / Phone (iOS is the current WIP)
In the near future, the goal is to add support for:
- C++ / SDL / Desktop (Windows, Linux)
- Javascript / WebGL
Warning: this library is in development and any API might change dramatically between releases. Use at your own peril.
To use plustd in your haxe projects, include these lines at the beginning of your make.hxml
(or within your command line arguments):
-D PLUSTD_TARGET=<specify target here>
-D PLUSTD_OS=<specify OS here>
-lib plustd
<compilation target here>
Here are the values of PLUSTD_TARGET
, PLUSTD_OS
according to their intended compilation target and platform:
Platform | PLUSTD_TARGET |
PLUSTD_OS |
Compilation target |
---|---|---|---|
C++ / SDL / Desktop | cppsdl.desktop |
osx , win , or linux |
-cpp |
C++ / SDL / Phone | cppsdl.phone |
ios or android |
-cpp |
Flash | flash |
(not used) | -swf |
JavaScript / Canvas | js.canvas |
(not used) | -js |
JavaScript / WebGL | js.webgl |
(not used) | -js |
Neko VM | neko |
(not used) | -neko |
To use the features of plustd, make your class extend sk.thenet.app.Application
and pass appropriate sk.thenet.app.ApplicationInit
values to super
in its constructor. The main
function is created automatically if you don't provide it:
import sk.thenet.FM;
import sk.thenet.app.*;
import sk.thenet.plat.Platform;
class Main extends Application {
public function new() {
super([
Framerate(60)
,Optional(Window("demo", 320, 240))
,Surface(160, 120, 1)
]);
addState(new Test(this));
mainLoop();
}
}
class Test extends State {
public function new(app:Main) {
super("test", app);
}
override public function tick() {
app.bitmap.fill(0xFF000000 | FM.prng.next());
}
}
See the samples and API documentation for more details.
- Make sure your
haxe
andhaxelib
is set up. - Run
haxelib git plustd https://github.com/Aurel300/plustd.git master package
to makehaxelib
use the git repo as a source for the library. - Navigate to
plustd/git/samples/01-basic/
. - Run
haxe make-swf.hxml
to test the Flash platform, orhaxe make-cpp.hxml
to test the C++ / SDL / Desktop platform (if you are on OS X). The output will bedemo.swf
anddemo/Main
respectively. The C++ build takes a long time when running for the first time.
.app
- Application frameworkApplication
base class for simple initialisation of event listeners and input / output devicesAssetManager
with support for hot reloading (local filesystem orWebsocket connection to plustd file watchdog)Embed
for cross-platform asset preloading
.audio
Output
- Code-generated audio outputSound
- Sound sample
.bmp
- Bitmap objects and manipulationBitmap
.crypto
- Encodings and cryptography.ds
- Data structures.event
- Simple events + listeners.format
- Binary formats for various data types.fsm
- Finite state machine.geom
- Geometric models.graph
- Graph algorithms.net
- Network protocols.plat
- Platform-dependent code, generally not accessed directly when using this library.common
- Code shared by some (but not all) platforms.cppsdl
.common
.desktop
- C++ / SDL / Desktop platform.phone
- C++ / SDL / Phone platform
.dummy
- Example platform.flash
- Flash platform.js
.common
.canvas
- JavaScript / Canvas platform.webgl
- JavaScript / WebGL platform (TODO)
.stream
- Streaming for functional programmingFM
- Fast MathsM
- Macro utilitiesU
- Utilities