Skip to content

Izzimach/om-react-pixi

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

om-react-pixi

Interactive example

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!"}))))

How to Include and Use

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.

Provided Forms

Includes the standard items from Pixi.js:

  • Stage
  • Sprite
  • SpriteBatch
  • TilingSprite
  • Text
  • BitmapText
  • DisplayObjectContainer

Running the examples

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

Running Tests

Tests are run inside slimerjs.

npm install slimerjs
lein cljsbuild test

About

Bindings for om to let you control pixi sprites from clojurescript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published