With the development of HTML5, more and more HTML5-based Web development frameworks are emerging. In today's article, we will introduce iio Engine, it is an open-source web framework for creating HTML5 applications.
The entire framework is very lightweight, only 45 KB in size, and is integrated with the debug system and supported across platforms.
Does not rely on any third-party class library, can support Box2D, with complete documentation support. Supports quick development.
To use this class library, you only need to use more than 10 lines of code to generate an tic-tac game. The Code is as follows:
TicTacToe = function (io ){
Var grid = io. addObj (new iio. ioGrid (120)
. SetStrokeStyle ('white '));
Var xTurn = true;
Io. canvas. addEventListener ('mousedown ', function (event ){
Var c = grid. getCellAt (io. getEventPosition (event), true );
If (typeof grid. cells [c. x] [c. y]. 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 [c. x] [c. y]. taken = true;
XTurn =! XTurn;
}
});
}; Iio. start (TicTacToe, 'canvasid ');