天天看點

《HTML5 canvas開發詳解(第2版)》——導讀

《HTML5 canvas開發詳解(第2版)》——導讀

前言

第2版介紹

自從本書第1版發行之後,在過去的兩年裡,html5 canvas的使用有了突飛猛進的增長。本書的第1版可以稱得上是第一批介紹canvas的專著之一。在我們為自己的快速而感到自豪同時也意味着我們曾經獨自進行了大量的研究和探索。早在2011年,隻有極少數html5 canvas應用的例子和教程。但在2013年情形發生了改變。現在有許多關于html5 canvas的資源可供選擇,從架構到api,有許多網站和書籍進行專門的闡述。為了編寫第2版,我們進行了大量艱辛的工作來檢查在第1版中哪些部分有效,哪些部分已經失效。在接下來的章節中,描述了一些令人激動的改變和更新,這幾頁是非正常值得期待的。

第1版的更新

本書大部分内容與第1版保持一緻。這樣做的原因是因為本書是面向廣泛開發者的,既有從來沒有接觸過canvas的開發者,也有已經有一些經驗想學習canvas進階使用技巧的開發者。

本書每一章都重新進行了修訂,對代碼進行更新和優化,更新浏覽器的相容性以及在過去兩年中發現的其他問題。一小部分内容被删除了。一些備援的代碼清單從書中移動到了代碼包中,友善了本書的閱讀。我們用更多更簡短的示例替換了第4章的部分内容。我們還完全重寫了第10章。我們删除了phonegap的介紹,這是因為類似的内容已經非常普遍了。

[第1章 html5 canvas簡介

<a href="https://yq.aliyun.com/articles/96525">1.2 基礎的html5頁面</a>

<a href="https://yq.aliyun.com/articles/96533">1.3 本書使用的基礎html頁面</a>

<a href="https://yq.aliyun.com/articles/96538">1.4 文檔對象模型(dom)和canvas</a>

<a href="https://yq.aliyun.com/articles/96540">1.5 javascript和canvas</a>

<a href="https://yq.aliyun.com/articles/96563">1.6 html5 canvas版“hello world!”</a>

<a href="https://yq.aliyun.com/articles/96565">1.7 用console.log調試</a>

<a href="https://yq.aliyun.com/articles/96571">1.8 2d環境及其目前狀态</a>

<a href="https://yq.aliyun.com/articles/96575">1.9 html5 canvas對象</a>

<a href="https://yq.aliyun.com/articles/96589">1.10 第二個示例:猜字母</a>

<a href="https://yq.aliyun.com/articles/96603">1.11 動畫版本的hello world</a>

<a href="https://yq.aliyun.com/articles/96605">1.12 内容預告</a>

[第2章 在canvas上繪圖

<a href="https://yq.aliyun.com/articles/96618">2.2 基本矩形</a>

<a href="https://yq.aliyun.com/articles/96621">2.3 canvas狀态</a>

<a href="https://yq.aliyun.com/articles/96629">2.4 使用路徑建立線段</a>

<a href="https://yq.aliyun.com/articles/96640">2.5 進階路徑方法</a>

<a href="https://yq.aliyun.com/articles/96645">2.6 在畫布上合成</a>

<a href="https://yq.aliyun.com/articles/96658">2.7 簡單畫布變換</a>

<a href="https://yq.aliyun.com/articles/96678">2.8 用顔色和漸變填充對象</a>

<a href="https://yq.aliyun.com/articles/96691">2.9 用圖案填充形狀</a>

<a href="https://yq.aliyun.com/articles/96699">2.10 建立陰影</a>

<a href="https://yq.aliyun.com/articles/96704">2.11 清除畫布的方法</a>

<a href="https://yq.aliyun.com/articles/96709">2.12 檢查一個點是否在目前路徑</a>

<a href="https://yq.aliyun.com/articles/96712">2.13 繪制一個焦點環</a>

<a href="https://yq.aliyun.com/articles/96716">2.14 内容預告</a>

第3章 html5 canvas的文本api

第4章 canvas圖像

第5章 數學、實體與動畫

第6章 在畫布中融合html5視訊

第7章 使用音頻

第8章 canvas遊戲(上)

第9章 canvas遊戲(下)

第10章 在移動裝置上開發

第11章 進一步探索

附錄 完整代碼清單

繼續閱讀