@Jasper_Holton's profile photo

A JavaScript Drawing - Coffee Mug I created this simple drawing with code today as a product photo for the new buttons. It's a drawing of a coffee mug, made by using ovals and rectangles. The code that draws it is below.

function init() {
    var stage = new createjs.Stage("coffee");
    var background = new createjs.Shape();
    var yoffset = 40;
    background.graphics.beginFill("DeepSkyBlue").drawRect(0, 0, 500, 500);
    stage.addChild(background);
    var circle = new createjs.Shape();
    circle.graphics.beginFill("White").drawEllipse(10 + 300 + yoffset, 250 - 150, 120, 300);
    stage.addChild(circle);
    var circle3 = new createjs.Shape();
    circle3.graphics.beginFill("DeepSkyBlue").drawEllipse(370, 90 + yoffset, 70, 240);
    stage.addChild(circle3);
    var mug = new createjs.Shape();
    mug.graphics.beginFill("White").drawRect(100, 60 + yoffset, 300, 300);
    stage.addChild(mug);
    var circle = new createjs.Shape();
    circle.graphics.beginFill("White").drawEllipse(250 - 150, 10 + yoffset, 300, 100);
    stage.addChild(circle);
    var circle2 = new createjs.Shape();
    circle2.graphics.beginFill("Brown").drawEllipse(250 - 130, 30 + yoffset, 260, 60);
    stage.addChild(circle2);
    var circle4 = new createjs.Shape();
    circle4.graphics.beginFill("White").drawEllipse(250 - 150, 10 + 300 + yoffset, 300, 100);
    stage.addChild(circle4);
    stage.update();
}


@Jasper_Holton, likes this,

Pinterest logo
Tumblr logo VK logo

https://uglek.com/post/454/ -

© Uglek, 2022

Terms of Use and Privacy Policy