|API||Uses canvas||Graphics libraries||AB framework||Worlds using this API||Starter Worlds|
|P5 (r2)||Yes||P5||No||588 Worlds||None|
This API is for P5 Worlds. It has no Ancient Brain framework. Anything written in P5 should run using this API without change.
This API has the following features:
AB.mind.getAction ( state );
ABWorld; // instance of class ABWorldClass ABWorld.canvas; // a variable to point to the canvas ABWorld.fullwidth(); // return full width of window on desktop / screen on mobile ABWorld.fullheight(); // return full height of window on desktop / screen on mobile
createCanvas ( ... );If the canvas does not display, or if the AB system fails to find the canvas for screenshots, help it out by telling it where the canvas is:
var canvas = createCanvas ( ... ); ABWorld.setCanvas ( canvas );