window.onload = function() {
//canvas拡張
$("canvas").attr({height:$("#wrapper").height()});
$("canvas").attr({width:$("#wrapper").width()});
//canvasをstageに
var stage = new Stage($("canvas")[0]);
//どう描くかを指定
var g = new Graphics();
g.beginFill("#888");
//すべての頂点の丸み半径を10に指定
g.drawRoundRect(-100,0,100,100,10);
//頂点の丸み半径を個別に指定
g.drawRoundRectComplex(0,-100,100,100,50,-10,50,0);
//シェイプオブジェクトに渡す
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: