Dominik
Dominik
  • 8
  • 32 725
1. Canvas - Setup and First Line
Code:
const canvas = document.querySelector('canvas')
canvas.width = window.innerWidth
canvas.height = window.innerHeight
const ctx = canvas.getContext('2d')
function drawLine(ctx, line) {
ctx.beginPath()
ctx.moveTo(line.start.x, line.start.y)
ctx.lineTo(line.end.x, line.end.y)
ctx.lineWidth = line.lineWidth
ctx.lineCap = line.lineCap
ctx.strokeStyle = line.strokeStyle
ctx.stroke()
}
const line = {
start: {
x: 100,
y: 100
},
end: {
x: 100,
y: 200
},
lineWidth: 50,
strokeStyle: 'blue',
lineCap: 'round',
}
drawLine(ctx, line)
zhlédnutí: 443

Video

5. Restructering Mouse Code
zhlédnutí 304Před 4 lety
This video is about 5. Restructering Mouse Code
4. Drawing a line on mouse drag
zhlédnutí 6KPřed 4 lety
Code: gist.github.com/dominikkaegi/dd17bf0fc26ceb7170a6b917a8ce58c1#4-drawing-a-line-on-mouse-drag
3. Drawing Points on mouse click
zhlédnutí 484Před 4 lety
This video is about 3. Drawing Points on mouse click
2. Deconstructing Objects with Default Values
zhlédnutí 186Před 4 lety
This video is about 2. Deconstructing Objects with Default Values
7. Drawing with requestAnimationFrame
zhlédnutí 278Před 4 lety
This video is about 7. Drawing with requestAnimationFrame
6. Drawing multiple lines
zhlédnutí 379Před 4 lety
This video is about 6. Drawing multiple lines
AIESEC Zurich - Stoff & Schnaps Roll Call
zhlédnutí 25KPřed 7 lety
This video is about Stoff & Schnaps Roll Call

Komentáře

  • @maykbrito
    @maykbrito Před rokem

    Thanks Dominik!

  • @zahrashariati2801
    @zahrashariati2801 Před rokem

    Can we have the code please?

    • @dominik3557
      @dominik3557 Před rokem

      gist.github.com/dominikkaegi/dd17bf0fc26ceb7170a6b917a8ce58c1#6-drawing-multiple-lines

  • @jmadachi
    @jmadachi Před rokem

    Good video, they did it a couple of years ago but it explains well the concepts to work with HTML Canvas

  • @ewaschenko
    @ewaschenko Před 2 lety

    How would you go about deleting 1 of the lines through the chart? For example if I drew 10 lines, I want to select the first line I drew with the mouse and delete.

  • @markrihter98
    @markrihter98 Před 2 lety

    Man, cool and interesting videos, thanks a lot!!

  • @mikoajkaleta6856
    @mikoajkaleta6856 Před 2 lety

    dude, let me download this code

    • @dominik3557
      @dominik3557 Před 2 lety

      I don't have it in a repo but in a github gist. You can find it here. gist.github.com/dominikkaegi/dd17bf0fc26ceb7170a6b917a8ce58c1 The 4th version on that gist is most likely the one corresponding to this video.

    • @mikoajkaleta6856
      @mikoajkaleta6856 Před 2 lety

      @@dominik3557 Thank you very much!

  • @malekabidi9000
    @malekabidi9000 Před 2 lety

    GOOD OL DAYS !!!!

  • @blackprince05
    @blackprince05 Před 2 lety

    can you show us the drawLine function please? because without it the program is not working fine

    • @dominik3557
      @dominik3557 Před 2 lety

      It is shown in a previous video, but here is a link to a gist with the code :) gist.github.com/dominikkaegi/dd17bf0fc26ceb7170a6b917a8ce58c1

  • @cyrinebenothmen8909
    @cyrinebenothmen8909 Před 2 lety

    lyrics please

    • @thephenomenalch650
      @thephenomenalch650 Před 2 lety

      czcams.com/video/oXlQFlHBzjk/video.html&ab_channel=RamonStoff tfadhli xD (lc tacapes مر من هنا)

  • @gordgood6506
    @gordgood6506 Před 2 lety

    Thanks man

  • @arminbromkamp3799
    @arminbromkamp3799 Před 5 lety

    Nicer Roll Call am start :D

  • @raxmaxify
    @raxmaxify Před 5 lety

    So good!

  • @lanadel3794
    @lanadel3794 Před 5 lety

    This roll call is my faaav!!!