HTML5 Canvas Tutorial Draw Lines and Filled Shapes Using JavaScript

preview_player
Показать описание
In this HTML5 canvas lesson we demonstrate how to plot and draw lines for custom shapes. Learn to draw shapes, fill them, stroke them, color them, and complete the homework assignment laid out in the video.
Рекомендации по теме
Комментарии
Автор

oh my god, it actually works, i've been doing this the hard way for so long, lol

i never learned it had in built functions for this

memesalldayjack
Автор

Yey!!

Basic maths, but it took a face-plant to see it, and I'm only a beginner. Great tuts by the way. :D

SDNeeve_Author
Автор

Man, you're little crazy :) You are the BOSS!

sspabu
Автор

@ktbsupremo Alpha is the transparency of the fill color. 1 for opaque, 0 for totally transparent or invisible.

RcmOmega
Автор

Cordial greetings. The other "flap" dimensions would be (approximately in sequence): ctx.beginPath(); ctx.moveTo(125, 60); ctx.lineTo(112, 72); ctx.lineTo(130, 95); ctx.lineTo(150, 70); ctx.lineTo(135, 180); ctxfill();

btwineume
Автор

Great tutorial thanks. Do you know what they browser compliance is like for this?

SharmaYelverton
Автор

hola, oye una pregunta en la parte de al principio de tu video, mencionas algo acerca de de la lógica para crear figuras con el ratón?, la pregunta seria haz tratado o desarrollado un programa que dibujes lineas con el raton pero a la vez con esas lineas hagas figuras como cuadrados o poligonos y que a la vez los guardes?? como muestras al principio del video

adriansilviano
Автор

Can you make a tutorial like how to create and resize a line in canvas? this appear in minute 0:58 i want to do that with the mouse like you in minute 0:58

Sobaco
Автор

how did you know which numbers ctx.lineTo(65, 40); did you use a graph calculator

lwsalahm
Автор

How do you increase the thickness of the line when you are stroking?

HarHar_hariOm
Автор

i waana learn coordinates. can u please help me for this. Like how can i make different drawing using coordinates. Any tools available for that. ?

nidhivadiwala
Автор

how can we draw something on an editor...ps, ai, and find out the exact coordinates to enter them in the canvas to obtain the exact image we want....?/??

neapopica
Автор

Is this faster rendered than an image?

smvsoren
Автор

Why do we need alpha?
do I have to put it in the fill style.

ktbsupremo
Автор

someone please explain to me why this does not work.<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<canvas id="paper" width="300" height="500"></canvas>
<script>
window.onload=draw;
function draw(){
var
var ctx=paper.getContext("2d")
ctx.rect(200, 200, 100, 60)
ctx.fill("black")
}
</script>
</body>
</html>

masterpaper
Автор

I did exactly how it was in the video but it isn't working.
Can someone help me?

tarun
Автор

Can anyone help me how to understand X Y coordinates

anomy
Автор

@smvsoren Good question ?! am also interested in the answer...

neapopica
Автор

how to draw democratic republic of congo flaf usig html and css, plz send me all code

MdIrfan-vzsi
Автор

hello, where's the next tutorial ?

umarkhay