Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rm-hull/monet
A ClojureScript visual library
https://github.com/rm-hull/monet
Last synced: 3 months ago
JSON representation
A ClojureScript visual library
- Host: GitHub
- URL: https://github.com/rm-hull/monet
- Owner: rm-hull
- Fork: true (ibdknox/monet)
- Created: 2012-09-16T21:55:44.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2017-01-06T18:10:42.000Z (almost 8 years ago)
- Last Synced: 2024-07-05T02:56:02.300Z (4 months ago)
- Language: Clojure
- Homepage: http://www.destructuring-bind.org/monet/
- Size: 151 KB
- Stars: 166
- Watchers: 9
- Forks: 11
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-clojurescript - Monet
README
# monet
[![Build Status](https://travis-ci.org/rm-hull/monet.svg?branch=master)](http://travis-ci.org/rm-hull/monet)
[![Dependencies Status](https://jarkeeper.com/rm-hull/monet/status.svg)](https://jarkeeper.com/rm-hull/monet)
[![Downloads](https://jarkeeper.com/rm-hull/monet/downloads.svg)](https://jarkeeper.com/rm-hull/monet)
[![Clojars Project](https://img.shields.io/clojars/v/rm-hull/monet.svg)](https://clojars.org/rm-hull/monet)
[![Maintenance](https://img.shields.io/maintenance/yes/2017.svg?maxAge=2592000)]()monet is a small ClojureScript library to make it easier (and
performant) to work with canvas and visuals.### Including in your project
There is a version hosted at [Clojars](https://clojars.org/rm-hull/monet).
For leiningen include a dependency:```clojure
[rm-hull/monet "0.3.0"]
```For maven-based projects, add the following to your `pom.xml`:
```xml
rm-hull
monet
0.2.2```
## Usage```clojure
(ns game.core
(:require [monet.canvas :as canvas])(def canvas-dom (.getElementById js/document "canvas"))
(def monet-canvas (canvas/init canvas-dom "2d"))
(canvas/add-entity monet-canvas :background
(canvas/entity {:x 0 :y 0 :w 600 :h 600} ; val
nil ; update function
(fn [ctx val] ; draw function
(-> ctx
(canvas/fill-style "#191d21")
(canvas/fill-rect val)))))
```## Documentation
See the [API Documentation](http://rm-hull.github.io/monet).
For more info on what the functions do look at the camel case versions
in JS docs (for example the
[mozilla developer network](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Canvas_tutorial?redirectlocale=en-US&redirectslug=Canvas_tutorial)).Some futher usage details can be found in
[doc/GUIDE.md](https://github.com/rm-hull/monet/blob/master/doc/GUIDE.md)## License
Copyright (C) 2011-14 Chris Granger, Richard Hull & others.
Distributed under the Eclipse Public License, the same as Clojure.