Coder Social home page Coder Social logo

drawjs's Introduction

DrawJS

Easy to use HTML5 canvas drawing library. The point is wrapping the canvas functions into a readable, OOP format, so you don't need to write 3 lines of code for one blue line.

To use it, just

<script src="./draw.js"></script>

Or pull it from the raw GitHub source

<script src="https://rawgit.com/RazorSh4rk/DrawJS/master/draw.js"></script>

Check the documentation for more info about the built in functions.

Drawing a cute animal is just 10 lines of code:

<canvas id="c"></canvas>
let d = new DrawJS('c')
d.circle(250, 250, 100, 'yellow', true)
var ear0=[
    new Vertex(240, 150),
    new Vertex(200, 100),
    new Vertex(150, 250)
]
var ear1=[
    new Vertex(260, 150),
    new Vertex(300, 100),
    new Vertex(350, 250)
]

//Draw the ears
d.polygon(ear0, 'yellow', true)
d.polygon(ear1, 'yellow', true)

//Draw the kawaii anime eyes (✧ω✧)
d.circle(210, 230, 15, 'black', true)
d.point(200, 225, 'white')
d.circle(290, 230, 15, 'black', true)
d.point(280, 225, 'white')

img

drawjs's People

Contributors

c3ypt1c avatar razorsh4rk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.