18 Temmuz 2016 Pazartesi

HTML5 CANVAS TEXT ALİGN ÖZELLİĞİ


<!DOCTYPE html>
<html>
    <head>
        <title>TODO supply a title</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="newCascadeStyleSheet.css" rel="stylesheet" type="text/css"/>
        <style>
            canvas{

                border:1px solid #d3d3d3;
                /*    background-color: #000;*/
            }
        </style>
    <script>
        window.onload = function () {
           var benimtuval = document.getElementById("mycanvas");
            var ctx = benimtuval.getContext("2d");
            ctx.font="30px arial";
            ctx.textAlign="start";//end:bitişe ekler  start:noktanın başına ekliyor ,right sağına ekler,left soluna ekler.
            ctx.fillText("merhaba dünya ",300,200);
         
           ctx.beginPath();
           ctx.arc(300,200,5,0*Math.PI,2*Math.PI);
           ctx.fill();
         
         }
    </script>


</head>
<body>

    <canvas id="mycanvas" width="600" height="400" >
        Your browser does not support the HTML5 canvas tag.</canvas>



</body>
</html>

Hiç yorum yok:

Yorum Gönder