- 授权协议: MIT
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: http://ocanvas.org/
- 软件文档: http://ocanvas.org/docs
- 官方下载: http://ocanvas.org/download
软件介绍
oCanvas 可以帮助你很容易的在 HTML5 的 Canvas 标签上创建对象,并且创建这些对象的动画。支持包括 IE9 以及更新版本和其他包括 FF、Chrome、Safari 和 Opera 浏览器。
该库包含 9 部分:
oCanvas Object: which represents the HTML5 Canvas element itself, where everything will be built.
Core: is the main instance which defines all other elements.
Display Objects: representing the main predefined geometrical elements (lines, triangles, rectangles, etc.).
Background: stores settings of object surface.
Canvas.Timeline: facilitates the creation of loops for moving objects.
Events: capturing the events that can occur with the keyboard, mouse, and touch.
Scenes: We can group objects into independent "frames".
Animation: Lets you create short animations for each object.
Draw: Module that allows you to clean or repaint the scenes.
示例代码:
function createAnim() {
//Block 1
var tela = oCanvas.create({
canvas: "#canvas",
background: "#ccc"
});
//Block 2
var quadrado = tela.display.rectangle({
x: 25,
y: 25,
width: 20,
height: 20,
fill: "#0aa",
velocX: 4,
velocY: 4
});
tela.addChild(quadrado);
//Block 3
tela.bind("click tap", function() {
quadrado.x = tela.mouse.x;
quadrado.y = tela.mouse.y;
});
//Block 4
tela.setLoop(function() {
quadrado.x += quadrado.velocX;
quadrado.y += quadrado.velocY;
quadrado.rotation++;
if ((quadrado.x <= 0) || (quadrado.x >= (tela.width)))
quadrado.velocX = -quadrado.velocX;
if ((quadrado.y < 20) || (quadrado.y > (tela.height - 20)))
quadrado.velocY = -quadrado.velocY;
}).start();
}
编程的修炼(中英双语)
[荷]Edsger W. Dijkstra / 裘宗燕 / 电子工业出版社 / 2013-7 / 79.00元
本书是图灵奖获得者Edsger W. Dijkstra在编程领域里的经典著作中的经典。作者基于其敏锐的洞察力和长期的实际编程经验,对基本顺序程序的描述和开发中的许多关键问题做了独到的总结和开发。书中讨论了顺序程序的本质特征、程序描述和对程序行为(正确性)的推理,并通过一系列从简单到复杂的程序的思考和开发范例,阐释了基于严格的逻辑推理开发正确可靠程序的过程。 本书写于20世纪70年代中后期,但......一起来看看 《编程的修炼(中英双语)》 这本书的介绍吧!
