Bindings for Om to let you create and control Pixi.js sprites from ClojureScript.
A simple example displaying text on a 400px by 300px canvas:
(defn simplestage [cursor]
(om/component
(pixi/stage #js {:width 400 :height 300}
(pixi/text #js {:x 100 :y 100 :text "argh!"}))))
The latest version is 0.5.0. In your project.clj
include this dependency:
[org.clojars.haussman/om-react-pixi "0.5.0"]
This will also include react-pixi which itself includes react 0.13.1.
Standard components are in the omreactpixi.core
namespace. There are also abbreviated forms that are based on the
forms used by om-tools which are located in omreactpixi.abbrev
.
In either case you may want to pull in the functions using the :as
form:
[omreactpixi.abbrev :as pixi]
so that you can refer to components using (for example) pixi/stage
or pixi/sprite
.
Includes the standard items from Pixi.js:
Build the examples using cljsbuild
lein cljsbuild once
The examples can be driven by figwheel, allowing you to edit the interactive example source and auto-reload
lein figwheel interactive
Tests are run inside slimerjs.
npm install slimerjs
lein cljsbuild test