![]() usr/lib/python2.5/site-packages/ on Unix,Ĭ:\python25\Lib\site-packages\ on Windows. Library/Python/2.5/site-packages/ on Mac, The standard location depends on your operating system, for example: Put the nodebox/ folder in the standard location for modules so it is available to all scripts. Put the nodebox/ folder in the same folder as your script. There are three basic ways to accomplish this: To be able to import NodeBox in your scripts, Python needs to know where the module is located. If that doesn't work, download the latest version manually. If you have pip, you can automatically download and install from the PyPi repository: If this is not the case, try updating to a new driver. Your video hardware needs support for OpenGL 2.0. Pyglet 1.4+ : an installer can be downloaded from Python 2.5-6 : an installer can be downloaded from On Mac OS X 10.6+ (Snow Leopard), you need to install a 32-bit version of Python (Pyglet won't work as expected with the preinstalled 64-bit version). Note: on Mac OS 10.5, Python is already installed. It works on all platforms if you have Python and Pyglet installed. NodeBox for OpenGL is built on the excellent Pyglet module. Its purpose is to implement a small game engine for "City In A Bottle" ( ).īSD, see LICENSE.txt for further details. ), offscreen rendering, animation & motion tweening, and simple 2D physics. It has support for Bezier paths, text, image filters (blur, bloom. It is based on the command set of the classic NodeBox for Mac OS X ( ). The built in constructor also gives you an instance of the Nodebox Renderer at for OpenGL (NOGL) is a Python module for creating 2D interactive visuals using OpenGL. This gives you a built in constructor that take the express req and res objects, as well as a loglevel. The first thing to note is that your handler must extend the NodeboxHandler class. There are a couple of different ways to assign views, layouts, and variables but the easiest is to initialize the Nodebox router with a config object that contains everything it needs.īelow is an example handler: const NodeboxHandler = require('nodebox-framework').NodeboxHandler A handler doesn't necessarily need a layout, but it does need a view to know HOW to render. As you can probably guess, these are located in the views and layouts folders respectively. Views and layouts are composed using the template functionality of lodash. A url like /home/foo/bar would be supported by a directory structure like: / Nodebox also supports more complex urls by nesting the directory structure. The handlers are stored in the /handlers folder of your project.įor the above example, the directory structure would look like: / Nodebox translates that call to load a handler named home (that returns a class), and call the about method. For example, if you went to the url: /home/about Nodebox translates your urls into system calls. Then add it as middleware: const express = require('express') Ĭonst Nodebox = require('nodebox-framework').Nodebox Ĭonst nodeBox = new Nodebox() Ĭonsole.log('Dev app listening on port 3000!') Pull Nodebox into your project: npm install nodebox-framework Nodebox handles all of your routing, and follows simple rules to translate urls into object and function calls so you can worry about creating your project instead of how to wire everything up. Nodebox is a lightweight framework for Node that acts as an Express middleware to quickly set up routes based on file system paths. ![]() Lightweight Node/Express framework based on Coldbox What is Nodebox?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |