没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > ofxjavascript |
ofxjavascript
|
0 | 0 | 13 |
贡献者 | 讨论 | 代码提交 |
AboutofxJavascript is an addon developped for openframeworks that allows applications to embed and execute Javascript thanks to Mozilla engine (called "Spidermonkey" / "Tracemonkey").
BindingsofxJavascript exposes several classes of openframeworks library to Javascript
Global functions ofxJSImage ofxJSTrueTypeFont ofxJSOpenGL ... more to come soon !
But you can also :
call your C++ functions from Javascript call Javascript functions from C++ create your "own" Javascript classes (like ofxJSImage for example)
ApplicationsLivecoding (coming very soon) is a parallel project built upon openframeworks and ofxjavascript that makes possible to modify a program while it is running.
ExampleScript used to generate the image above :
//--------------------------------------------------------------
function setup()
{
of.SetWindowTitle("OpenframeworksJS / testFontWheel.js");
myFont = new ofxJSTrueTypeFont();
myFont.loadFont("Batang.ttf",20);
of.SetWindowShape(1000, 300);
of.SetBackgroundAuto(false);
of.SetVerticalSync(true);
of.EnableSmoothing();
of.Background(0,0,0);
data =
}
//--------------------------------------------------------------
function update()
{
rot = -(mouseX-of.GetWidth()/2)/of.GetWidth() * 360;
}
//--------------------------------------------------------------
function draw()
{
of.Background(0,0,0);
var strings = data.t;
var nb = data.t.length();
of.Translate(of.GetWidth()/2,of.GetHeight()/2,-30);
of.RotateX(-20);
of.RotateY(rot);
for (i=0;iJavascript versionofxJavascript includes Javascript v1.6
LinksMozilla Spidermonkey Javascript tips JSLibs