Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var canvas = document.getElementById('exampleCanvas'),
- context = canvas.getContext('2d');
- // code examples will continue here...
- // Tekstas
- context.font = 'italic 40px Calibri, sans-serif';
- context.fillText('Hello World!', 50, 50);
- context.beginPath();
- context.moveTo(0,0);
- // Liniju piesimas
- for(var i = 0; i < 100; i++) {
- context.lineTo(i*5 * i + 50,i*2 + 5);
- }
- context.fillStyle = "red";
- context.fillRect(10, 10, 100, 50);
- context.strokeStyle = "blue";
- context.strokeRect(5, 5, 50, 50);
- context.lineWidth = 5;
- context.strokeRect(135, 5, 50, 50);
- for (var y = 10; y < 100; y += 10) {
- context.moveTo(10, y);
- context.lineTo(90, y);
- }
- context.stroke();
- context.moveTo(100, 250);
- context.bezierCurveTo(150, 100, 350, 100, 400, 250);
- context.stroke();
- });
- // Variantas be jquery
- document.addEventListner("DOMContentLoaded", function() {
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement