23

All Text Tricks in the Book, with JavaScript and Canvas

  • Upload
    fitc

  • View
    115

  • Download
    0

Embed Size (px)

DESCRIPTION

All Text Tricks in the Book, with JavaScript and Canvas with Sakri Rosenstrom Presented live at FITC Amsterdam 2014 on Feb 24-25, 2014 More details can be found at www.FITC.ca Sakri has put together a collection of what can be done with text on the HTML5 Canvas using JavaScript. Drawing from nearly 15 years of coding visual effects, the bag of tricks is heavy. This session will start with the basics and move on with increasing complexity; each demo will be accompanied with key concepts, snippets of code and ideas for further exploration. To avoid any confusion or prerequisites, the demos are all built from scratch with minimal use of external libraries or frameworks. While the talk is centered around text effects, the techniques presented are certainly applicable outside the world of text effects and Canvas.

Citation preview

Page 1: All Text Tricks in the Book, with JavaScript and Canvas
Page 2: All Text Tricks in the Book, with JavaScript and Canvas

Html5 CanvasHtml5 CanvasWhat? Where? When?

Page 3: All Text Tricks in the Book, with JavaScript and Canvas

• Loaders / Splash Screens

• Games, full screen apps

• Light Boxes

• Responsive layouts, only show on big screens

• Demos ;)

Use CasesUse Cases

Page 4: All Text Tricks in the Book, with JavaScript and Canvas

Canvas Text APICanvas Text APIThe Definitive guide

Page 5: All Text Tricks in the Book, with JavaScript and Canvas
Page 6: All Text Tricks in the Book, with JavaScript and Canvas

That’s itThat’s itDemo time?!

Page 7: All Text Tricks in the Book, with JavaScript and Canvas

FormattingFormatting• Nope

• Nope

• Multiline

• Kerning

…but this is probably a good thing.

Page 8: All Text Tricks in the Book, with JavaScript and Canvas

TransformsTransforms• rotate(radian)

• translate(x , y)

• scale(x, y)

• setTransform(xScale, xSkew, ySkew, yScale, x ,y )

Page 9: All Text Tricks in the Book, with JavaScript and Canvas

Animating blocksAnimating blocks

Page 10: All Text Tricks in the Book, with JavaScript and Canvas

PerformancePerformanceHow many particles?

Page 11: All Text Tricks in the Book, with JavaScript and Canvas
Page 12: All Text Tricks in the Book, with JavaScript and Canvas
Page 13: All Text Tricks in the Book, with JavaScript and Canvas

BitmapsBitmaps• drawImage()

• getImageData()

• putImageData()

• toDataURL()

Page 14: All Text Tricks in the Book, with JavaScript and Canvas
Page 15: All Text Tricks in the Book, with JavaScript and Canvas

Text Height?Text Height?

Page 16: All Text Tricks in the Book, with JavaScript and Canvas

Marching SquaresMarching Squares

Page 17: All Text Tricks in the Book, with JavaScript and Canvas

Circular WanderCircular Wander

Page 18: All Text Tricks in the Book, with JavaScript and Canvas

Snow manSnow man

Page 19: All Text Tricks in the Book, with JavaScript and Canvas

Circular Wander TextCircular Wander Text

Page 20: All Text Tricks in the Book, with JavaScript and Canvas
Page 21: All Text Tricks in the Book, with JavaScript and Canvas

Codepen.ioCodepen.io

Page 22: All Text Tricks in the Book, with JavaScript and Canvas

Codepen.io/sakriCodepen.io/sakri

Page 23: All Text Tricks in the Book, with JavaScript and Canvas