Article introduction of Wulin.com (www.vevb.com): Open source HTML5 application development framework - iio Engine.
With the development of HTML5, more and more web development frameworks based on HTML5 technology have emerged. In this article today, we will introduce iio Engine, which is an open source web framework for creating HTML5 applications.
The entire framework is very lightweight, only 45kb in size, and integrates debug system and supports it across platforms.
It does not rely on any third-party class library, can support Box2D, and has complete documentation support. Supports rapid development.
Using this class library, you only need to use more than 10 lines of code to generate a tic-tac game, the code is as follows:
TicTacToe = function(io){var grid = io.addObj(new iio.ioGrid(0,0,3,3,120)
.setStrokeStyle('white'));
var xTurn=true;
io.canvas.addEventListener('mousedown', function(event){
var c = grid.getCellAt(io.getEventPosition(event),true);
if (typeof grid.cells[cx][cy].taken == 'undefined'){
if (xTurn)
io.addObj(new iio.ioX(grid.getCellCenter(c),80)
.setStrokeStyle('red',2));
else
io.addObj(new iio.ioCircle(grid.getCellCenter(c),40)
.setStrokeStyle('#00baff',2));
grid.cells[cx][cy].taken=true;
xTurn=!xTurn;
}
});
}; iio.start(TicTacToe,'canvasId');