+ All Categories
Home > Technology > Intro to facade

Intro to facade

Date post: 05-Dec-2014
Category:
Upload: cantina
View: 182 times
Download: 2 times
Share this document with a friend
Description:
An introduction of the HTML5 canvas drawing library Facade.js and how it compares to working in native canvas. Code: https://github.com/neogeek/talks/tree/master/intro-to-facadejs
42
Intro to Facade.js Drawing shapes, images and text in HTML5 canvas made easy.
Transcript
Page 1: Intro to facade

Intro to Facade.jsDrawing shapes, images and text

in HTML5 canvas made easy.

Page 2: Intro to facade

@neogeekScott Doxey

Page 3: Intro to facade

I’m a user experience consultant at

Page 4: Intro to facade

Disclaimer: I built Facade.js

Page 5: Intro to facade

In October of 2012 ! GitHub hosted a

Game Jam.

Page 6: Intro to facade

The theme was " forking, # branching,

and $ cloning.

Page 7: Intro to facade

I didn’t build a game.

Page 8: Intro to facade

Instead I built a library for drawing in canvas.

Page 9: Intro to facade

After three versions, I’m ready to share.

Page 10: Intro to facade

Let’s talk about canvas.

Page 11: Intro to facade

It’s easy enough to use.But it could be easier.

Page 12: Intro to facade

Drawing a rectangle.

Page 13: Intro to facade

Drawing a rectangle with a stroke.

Page 14: Intro to facade

Drawing a circle.

Page 15: Intro to facade

Drawing a circle with a stroke.

Page 16: Intro to facade

Drawing a polygon.

Page 17: Intro to facade

Drawing a polygon with a stroke.

Page 18: Intro to facade

Positioning an object.

Page 19: Intro to facade

Rotating an object.

Page 20: Intro to facade

Rotating an object from the center.

Page 21: Intro to facade

Scaling an object.

Page 22: Intro to facade

Scaling an object from the center.

Page 23: Intro to facade

Now compare native canvas and Facade.js

Page 24: Intro to facade

Native canvas

Page 25: Intro to facade

Facade.js

Page 26: Intro to facade

Some advantages of this format.

• Easy to read.

• Format is key/value pairs (similar to CSS).

• Importable from JSON.

Page 27: Intro to facade

So what is Facade.js?

Page 28: Intro to facade

Facade.js is a wrapper around the canvas 2d

rendering context.

Page 29: Intro to facade

What does that mean?

Page 30: Intro to facade

More drawing, less coding.

Page 31: Intro to facade

How to get started with Facade.js

Page 32: Intro to facade

http://play.facadejs.com

Page 33: Intro to facade

http://docs.facadejs.com

Page 34: Intro to facade

http://plugins.facadejs.com

Page 35: Intro to facade

Plugins in Development

• Gamepad.js - Simple customizable event binding for the HTML Gamepad API.

• Box2D-plugin - A wrapper for the Box2D JavaScript library.

• SATjs-plugin - A wrapper for the SAT-js library, a simple JavaScript library for performing 2D collision detection.

Page 36: Intro to facade

https://github.com/facadejs/Facade.js

Page 37: Intro to facade

https://github.com/facadejs

Page 38: Intro to facade

• Interactive Demos: http://play.facadejs.com

• Documentation: http://docs.facadejs.com

• Plugins: http://plugins.facadejs.com

• ! Repo: http://github.com/facadejs/Facade.js

• ! Organization: http://github.com/facadejs

Page 39: Intro to facade

Questions?

Page 40: Intro to facade

DEMO

Page 41: Intro to facade

Thank you!

Page 42: Intro to facade

Scott Doxey !

twitter.com/@neogeek github.com/neogeek


Recommended