The Two.js Framework PRO

The two.js JavaScript library provides us with the capability to create two dimensional drawings and animations.

The following code sample shows how simple it is to use this library. If you try to run this code on your end make sure you update the link for the underscore-min.js file.

<!DOCTYPE html>
<html>
<head>
    <title>two.js demo</title>
    <script type="text/javascript" src="underscore-min.js"></script>
    <script type="text/javascript" src="backbone-min.js"></script>
    <script type="text/javascript" src="two.min.js">
    </script>
</head>
<body>
    <div id="drawingarea"></div>
    <script type="text/javascript">
        var ob = document.getElementById('drawingarea');
        var params = { width: 600, height: 400 };
        var two = new Two(params);
        two.appendTo(ob);
        var circle = two.makeCircle(200, 100, 80);
        circle.fill = '#DD99EE';
        circle.stroke = 'red';
        circle.linewidth = 4;
        two.update();
    </script>
</body>
</html>

The following video clip shows the execution of this code sample and explains it. You can find more video clips for learning how to use this library in my dedicated youtube playlist for two.js.

You can find more video clips, code samples and training material for learning how to use this library in my free (for personal use) Two.js Basics course at http://abelski.lifemichael.com.

Share:

banner for the css playlist in hebrew life michael courses for programmers

The First Steps in CSS

Learn CSS using our our videos (in Hebrew) on the CSS (he) playlist on youtube. Do it now. Do it for free.

Good Trainers Collaborate with Others

It is always essential to keep an open mind and learn from others. This applies to everyone, including teachers and especially software development trainers. Software

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences