Foundation HTML5 Canvas [electronic resource] : For Games and Entertainment /
Hawkes, Rob.author.
Foundation HTML5 Canvas: For Games and Entertainment teaches you how to make exciting interactive games and applications using HTML5 canvas. Canvas lets you produce graphics, animations, and applications using the HTML5 and JavaScript web standards. It allows you to draw directly within the browser without the need for third-party plugins like Adobe Flash, and so canvas works perfectly across desktop and mobile devices, like the iPhone and Android. Foundation HTML5 Canvas begins by introducing you to HTML5 and the cool new features that it opens up for you. You are then offered a quick guide to JavaScript programming to get you up to speed. Next up you'll receive a thorough introduction to the canvas element, which teaches you how to draw objects within the browser with great ease. Once the basics are covered you'll move on to the more advanced features of canvas, including image and video manipulation. You'll also learn how to create realistic animations with the help of some basic physics. Foundation HTML5 Canvas then teaches you how to create two thrilling space-based games using all the skills you've learned so far. You'll find plenty of code examples and illustrations designed to help you understand even the most complex of topics. HTML5 is already here for you, and this book will provide you with all the information you need to enjoy the show. For more information, source code, and the latest blog posts from author Rob Hawkes, visit http://rawkes.com/foundationcanvas.
Title Page; Copyright Page; Contents at a Glance; Table of Contents; About the Author; About the Technical Reviewer; About the Cover Image Designer; Acknowledgments; Preface; Chapter 1 Introducing HTML5; A brief history of HTML; Why is HTML5 needed?; The itch; Scratching the itch; What's new in HTML5?; Structural and content elements; Structure in HTML5; The section element; The header element; The hgroup element; The footer element; The nay element; The article element; The aside element; Content in HTML5; The figure element; The figcaption element; The mark element; The time element; Forms
Validation In the browserInput types; Input attributes; Media elements; The audio element; The video element; The canvas element; Deconstructing an example HTML5 page; Line by line analysis; Misconceptions about HTMLS; The CSS3 misconception; The Web Fonts misconception; The Geolocation misconception; The SVG misconception; The Web Storage misconception; The Web Workers misconception; The WebSockets misconception; Summary; FurtherHTML5resources; Chapter 2 Foundation JavaScript; An overview of JavaScript; jQuery; What is jQuery?; Why are we using it?; Isn't this cheating?
Does this mean I won't understand pure JavaScript?How do I start using jQuery?; Adding JavaScript to an HTML page; Running JavaScript after the page has loaded; The wrong way (the window.onload event); The long way (the DOM); The easy way (the jQuery way); Variables and data types; Variables; Naming variables; Declaring variables and assigning values; Accessing variables; Arithmetic; Data types; Primitive data types; Composite data types; Other data types; Conditional statements; If statements; Comparison operators; Multiple truth checks within an if statement; Else and else if statements
FunctionsCreating functions; Calling functions; Objects; What are objects?; Creating and using objects; Arrays; Creating arrays; Accessing and modifying arrays; Loops; Timers; Setting one-off timers; Unsetting one-off timers; Setting repeating timers; Unsetting repeating timers; The DOM; An example HTML web page; Accessing the DOM using pure JavaScript; Accessing the DOM using jQuery; Manipulating the DOM; Summary; Chapter 3 Learning the Basics of Canvas; Getting friendly with the canvas element; Browser support for canvas; The 2d rendering context; The coordinate system
Accessing the 2d rendering contextDrawing basic shapes and lines; Lines; Circles; Style; Changing line width; Drawing text; Erasing the canvas; The width/height trick; Making canvas fill the browser window; Summary; Chapter 4 Pushing Canvas Further; Saving and restoring the drawing state; What is the canvas drawing state?; Saving the drawing state; Restoring the drawing state; Saving and restoring multiple drawing states; Transformations; Translation; Scaling; Rotation; The transformation matrix; Manipulating the transformation matrix; Compositing; Global alpha; Composite operations; Shadows
Gradients
Includes index.
Foundation HTML5 Canvas: For Games and Entertainment teaches you how to make exciting interactive games and applications using HTML5 canvas. Canvas lets you produce graphics, animations, and applications using the HTML5 and JavaScript web standards. It allows you to draw directly within the browser without the need for third-party plugins like Adobe Flash, and so canvas works perfectly across desktop and mobile devices, like the iPhone and Android. Foundation HTML5 Canvas begins by introducing you to HTML5 and the cool new features that it opens up for you. You are then offered a quick guide to JavaScript programming to get you up to speed. Next up you'll receive a thorough introduction to the canvas element, which teaches you how to draw objects within the browser with great ease. Once the basics are covered you'll move on to the more advanced features of canvas, including image and video manipulation. You'll also learn how to create realistic animations with the help of some basic physics. Foundation HTML5 Canvas then teaches you how to create two thrilling space-based games using all the skills you've learned so far. You'll find plenty of code examples and illustrations designed to help you understand even the most complex of topics. HTML5 is already here for you, and this book will provide you with all the information you need to enjoy the show. For more information, source code, and the latest blog posts from author Rob Hawkes, visit http://rawkes.com/foundationcanvas.
Canvas (Computer file)
Computer programming.
Software engineering.
Web Development.
Software Engineering/Programming and Operating Systems.