-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-commit of v2.0.0. Previous commit not complete.
- Loading branch information
Showing
3 changed files
with
466 additions
and
548 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,42 @@ | ||
# Graphics.Render | ||
|
||
Graphics.Render is a lightweight graphics library for Elm. It is intended primarily to | ||
replace the hole left by the deprecation of Graphics.Collage. The API of Graphics.Render | ||
is similar to that of the older library, so it should feel familiar, to those who have | ||
used it before. However, there are a few major changes to be aware of between | ||
this library and Graphics.Collage. Most notably, the origin of the coordinate system of the | ||
render library is positioned at the center of the viewbox, rather than the top left corner, | ||
and render compiles to SVG rather the HTML5 canvas. For more in depth documentation, take a | ||
look at the documentation for the | ||
[Graphics.Render module](http://package.elm-lang.org/packages/Kwarrtz/render/1.0.0/Graphics-Render). | ||
|
||
NOTE THAT THIS LIBRARY IS STILL VERY MUCH EXPERIMENTAL, AND THE API IS SUBJECT TO CHANGE. | ||
Graphics.Render is a lightweight graphics library for Elm. It is intended primarily to | ||
replace the hole left by the deprecation of Graphics.Collage. The API of Graphics.Render | ||
is similar to that of the older library, so it should feel familiar, to those who have | ||
used it before. However, there are a few major changes to be aware of between this library | ||
and Graphics.Collage. Most notably that it currently compiles to SVG rather the HTML5 canvas | ||
(although support for this latter option is planned). For more in depth documentation, take a | ||
look at the documentation for the [Graphics.Render module](http://package.elm-lang.org/packages/Kwarrtz/render/latest/Graphics-Render). | ||
|
||
My life has suddenly become much busier than it was when I started this project, so I doubt I will be | ||
able to devote much time to it in the coming months. Still, if you notice any outstanding issues | ||
feel free to open an issue, and I will try to get to it when I can. | ||
|
||
NOTE THAT THIS LIBRARY IS STILL VERY EXPERIMENTAL, AND ITS API IS SUBJECT TO CHANGE. | ||
|
||
## Notes for v2.x.x | ||
|
||
As of version 2.0.0, positions are now from the top left hand corner of the viewport rather than the center. There are several other major changes to the API from version 1.x.x. For more details, take a look at [the | ||
documentation](http://package.elm-lang.org/packages/Kwarrtz/render/latest/Graphics-Render). | ||
|
||
## Examples | ||
|
||
The following Elm code draws a blue ellipse with a black border. | ||
The following Elm code draws a blue ellipse with a black border at position (100,100) in a | ||
500x500 SVG viewport. | ||
|
||
import Graphics.Render as Render | ||
import Graphics.Render exposing (ellipse, filledAndBordered, position, svg) | ||
import Color exposing (rgb) | ||
|
||
main = Render.ellipse 150 150 | ||
|> Render.solidFillWithBorder (rgb 0 0 255) 5 (rgb 0 0 0) | ||
|> Render.svg 500 500 | ||
|
||
main = ellipse 150 150 | ||
|> filledAndBordered (solid <| rgb 0 0 255) | ||
5 (solid <| rgb 0 0 0) | ||
|> position (100,100) | ||
|> svg 500 500 | ||
|
||
## TODO | ||
|
||
* Gradient fills | ||
* Paths and arcs | ||
* Apply for Elm native JS whitelist | ||
* HTML5 canvas support | ||
* Add examples | ||
* Improve documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.