window.onload = function() {
$("canvas").attr({height:$("#wrapper").height()});
$("canvas").attr({width:$("#wrapper").width()});
var stage = new Stage($("canvas")[0]);
var g = new Graphics();
//カラーコードで指定
g.beginFill("#800000");
g.drawCircle(-150,0,30);
//カラーネームで指定で指定
g.beginFill("black");
g.drawCircle(-100,0,30);
//RGB名前空間をべた書きで使用
g.beginFill("rgba(100,200,0,0.5)");
g.drawCircle(-50,0,30);
//RGB名前空間を使用
g.beginFill(Graphics.getRGB(220,0,50,0.5));
g.drawCircle(0,0,30);
//HSL名前空間を使用
g.beginFill(Graphics.getHSL(180,50,50,0.5));
g.drawCircle(50,0,30);
var s = new Shape(g);
s.x = $(window).width()/2;
s.y = $(window).height()/2;
stage.addChild(s);
stage.update();
}
<div id="wrapper">
<canvas></canvas>
</div>
html{
min-height: 100%;
overflow: auto;
position:relative;
z-index: 1;
}
body{
min-height: 100%;
margin: 0;
padding: 0;
overflow: auto;
position: relative;
z-index: 1;
}
#wrapper{
height: auto;
overflow: auto;
position: fixed;
z-index: 1;
width: 100%;
height:100%;
min-height:100%;
}
canvas{
position: fixed;
}
External resources loaded into this fiddle: