<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wowcube.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Raccoon+pirate</id>
	<title>WowWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wowcube.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Raccoon+pirate"/>
	<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/wiki/Special:Contributions/Raccoon_pirate"/>
	<updated>2026-05-20T07:25:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=16506</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=16506"/>
		<updated>2022-02-11T06:50:12Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* Physics_Circle_vs_AABB_obj */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 256 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 256 bytes.&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[GAME_SAVE_SIZE];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[GAME_SAVE_SIZE - 1] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sound functions===&lt;br /&gt;
====abi_CMD_PLAYSND====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_PLAYSND(const id, const volume)&lt;br /&gt;
Description:&lt;br /&gt;
: Play chosen sound with a given volume.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''id''&lt;br /&gt;
:: Sound serial number in the application package.&lt;br /&gt;
: ''volume''&lt;br /&gt;
:: The sound volume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
====abi_CMD_NET_TX====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_NET_TX(const line_tx, const TTL, const data[])&lt;br /&gt;
Description:&lt;br /&gt;
: Send data through given UART line with given TTL.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''line_tx''&lt;br /&gt;
:: UART line for sending a message. Each module has 3 UART lines.&lt;br /&gt;
: ''TTL''&lt;br /&gt;
:: Message time to live. How many modules message will pass through before stopping. For example, set TTL to 0 message will transfer only to the neighbor module. Set TTL to 1 message will transfer to a neighbor of neighbor. Maximum TTL is 2.&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Data array to send. Maximum can be sent 20 bytes. The first 4 bytes are message general information that automatically adds before sending. The maximum useful data that can be sent are 16 bytes. Taking into account net command name 15 bytes.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
We want to receive data only from 0 module&lt;br /&gt;
&lt;br /&gt;
 // define net command&lt;br /&gt;
 #define NEW_TEST_NET_COMMAND P2P_CMD_BASE_SCRIPT_1 + 1&lt;br /&gt;
 &lt;br /&gt;
 // create message to send&lt;br /&gt;
 Send_Test_Message() {&lt;br /&gt;
    new data[4];&lt;br /&gt;
    data[0] = NEW_TEST_NET_COMMAND | (abi_cubeN &amp;lt;&amp;lt; 8);&lt;br /&gt;
    data[1] = add_game_data;&lt;br /&gt;
    // using bitwise operations send more data&lt;br /&gt;
    data[2] = add_script_data_1 | (add_script_data_2 &amp;lt;&amp;lt; 8) | (add_script_data_3 &amp;lt;&amp;lt; 16) | (add_script_data_4 &amp;lt;&amp;lt; 24);&lt;br /&gt;
    data[3] = add_game_data_1 | (add_game_data_2 &amp;lt;&amp;lt; 16);&lt;br /&gt;
    &lt;br /&gt;
    // send message through UART&lt;br /&gt;
    abi_CMD_NET_TX(0, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(1, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(2, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // process the received message&lt;br /&gt;
 ON_CMD_NET_RX (const pkt[]) {&lt;br /&gt;
    // get 4 byte from incoming packet to get net command because first 4 bytes are general info&lt;br /&gt;
    switch (abi_ByteN(pkt, 4)) {&lt;br /&gt;
        case NEW_TEST_NET_COMMAND: {&lt;br /&gt;
            if (abi_ByteN(pkt, 5) == 0) {&lt;br /&gt;
                game_data = pkt[2];&lt;br /&gt;
                script_data_1 = abi_ByteN(pkt, 12);&lt;br /&gt;
                script_data_2 = abi_ByteN(pkt, 13);&lt;br /&gt;
                script_data_3 = abi_ByteN(pkt, 14);&lt;br /&gt;
                script_data_4 = abi_ByteN(pkt, 15);&lt;br /&gt;
                game_data_1 = pkt[4] &amp;amp; 0xFFFF;&lt;br /&gt;
                game_data_2 = (pkt[4] &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Physics functions===&lt;br /&gt;
====PHYSICS_CIRCLE_DATA====&lt;br /&gt;
Syntax:&lt;br /&gt;
  #define PHYSICS_CIRCLE_DATA .posX, .posY, .simplePosX, .simplePosY, .spdX, .spdY, .mass, .radius, .CoR, .cube, .face, .cubeT, .faceT&lt;br /&gt;
Description:&lt;br /&gt;
: PAWN symbolic subscript which represent stucture.&lt;br /&gt;
Fields&lt;br /&gt;
: ''posX''&lt;br /&gt;
:: Circle position on X axis (fixed point)&lt;br /&gt;
: ''posY''&lt;br /&gt;
:: Circle position on Y axis (fixed point)&lt;br /&gt;
: ''simplePosX''&lt;br /&gt;
:: Circle position on X axis&lt;br /&gt;
: ''simplePosY''&lt;br /&gt;
:: Circle position on Y axis&lt;br /&gt;
: ''spdX''&lt;br /&gt;
:: Circle X speed&lt;br /&gt;
: ''spdY''&lt;br /&gt;
:: Circle Y speed&lt;br /&gt;
: ''mass''&lt;br /&gt;
:: Circle mass (fixed point)&lt;br /&gt;
: ''radius''&lt;br /&gt;
:: Circle radius&lt;br /&gt;
: ''CoR''&lt;br /&gt;
:: Coefficient of restitution (fixed point)&lt;br /&gt;
: ''cube''&lt;br /&gt;
:: Module owner of this circle&lt;br /&gt;
: ''face''&lt;br /&gt;
:: Face owner of this circle&lt;br /&gt;
: ''cubeT''&lt;br /&gt;
:: Cube transfer, last module owner. Can be used for resending messages&lt;br /&gt;
: ''faceT''&lt;br /&gt;
:: Face transfer, last face owner. Can be used for resending messages&lt;br /&gt;
&lt;br /&gt;
====Physics_Circle_Vs_Circle_obj====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Circle_Vs_Circle_obj(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Check circle versus circle collision.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle1&lt;br /&gt;
:: First circle object.&lt;br /&gt;
: circle2&lt;br /&gt;
:: Second circle object.&lt;br /&gt;
&lt;br /&gt;
====Physics_Circle_vs_AABB_obj====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Circle_vs_AABB_obj(circle[PHYSICS_CIRCLE_DATA], rectX, rectY, rectWidth, rectHeight, fakeCircle[PHYSICS_CIRCLE_DATA] = 0)&lt;br /&gt;
Description:&lt;br /&gt;
: Check circle versus rectangle collision.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object.&lt;br /&gt;
: rectX&lt;br /&gt;
:: X coordinate of top left rectangle corner.&lt;br /&gt;
: rectY&lt;br /&gt;
:: Y coordinate of top left rectangle corner.&lt;br /&gt;
: rectWidth&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: rectHeight&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: fakeCircle&lt;br /&gt;
:: In case of collision returns the collision point.&lt;br /&gt;
&lt;br /&gt;
====Physics_Circle_Vs_LineSegment====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Circle_Vs_LineSegment(circle[PHYSICS_CIRCLE_DATA], lineSX, lineSY, lineEX, lineEY, fakeCircle[PHYSICS_CIRCLE_DATA] = 0)&lt;br /&gt;
Description:&lt;br /&gt;
: Check circle versus line segment collision.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object.&lt;br /&gt;
: lineSX&lt;br /&gt;
:: Line start X coordinates.&lt;br /&gt;
: lineSY&lt;br /&gt;
:: Line start Y coordinate.&lt;br /&gt;
: lineEX&lt;br /&gt;
:: Line end X coordinate.&lt;br /&gt;
: lineEY&lt;br /&gt;
:: Line end Y coordinate.&lt;br /&gt;
: fakeCircle&lt;br /&gt;
:: In case of collision returns the collision point.&lt;br /&gt;
&lt;br /&gt;
====Physics_Res_CvC_Coll_Massless====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Res_CvC_Coll_Massless(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Collision resolves without using object mass.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle1&lt;br /&gt;
:: First circle object.&lt;br /&gt;
: circle2&lt;br /&gt;
:: Second circle object.&lt;br /&gt;
&lt;br /&gt;
====Physics_Res_CvC_Coll_Mass====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Res_CvC_Coll_Mass(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Resolves collision using object mass.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle1&lt;br /&gt;
:: First circle object.&lt;br /&gt;
: circle2&lt;br /&gt;
:: Second circle object.&lt;br /&gt;
&lt;br /&gt;
====Physics_DeserializeCircle====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_DeserializeCircle(serializedData_1, serializedData_2, circle[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Deserialize circle object.&lt;br /&gt;
Arguments:&lt;br /&gt;
: serializedData_1&lt;br /&gt;
:: First part of serialized circle data.&lt;br /&gt;
: serializedData_2&lt;br /&gt;
:: Second part of serialized circle data.&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object where need to save deserialized data.&lt;br /&gt;
&lt;br /&gt;
====Physics_SerializeCircle====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_SerializeCircle(obj[PHYSICS_CIRCLE_DATA], &amp;amp;serializedData_1, &amp;amp;serializedData_2)&lt;br /&gt;
Description:&lt;br /&gt;
: Serialize circle object.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object to serialize.&lt;br /&gt;
: serializedData_1&lt;br /&gt;
:: Return first part of serialized circle data.&lt;br /&gt;
: serializedData_2&lt;br /&gt;
:: Return second part of serialized circle data.&lt;br /&gt;
&lt;br /&gt;
====Physics_Overlap====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Overlap(overlap, positionDifference, distance)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the distance by which objects overlap.&lt;br /&gt;
Arguments:&lt;br /&gt;
: overlap&lt;br /&gt;
:: Half distance between two points.&lt;br /&gt;
: positionDifference&lt;br /&gt;
:: Position difference between two point in one axis. Example - first point position X is 10, second is 6. Then position difference is 10-6=4.&lt;br /&gt;
: distance&lt;br /&gt;
:: Distance between two points.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Create circle object.&lt;br /&gt;
 &lt;br /&gt;
 new ball_1[PHYSICS_CIRCLE_DATA];&lt;br /&gt;
 ball_1.posX = 180 &amp;lt;&amp;lt; 8;&lt;br /&gt;
 ball_1.posY = 180 &amp;lt;&amp;lt; 8;&lt;br /&gt;
 ball_1.simplePosX = 200;&lt;br /&gt;
 ball_1.simplePosY = 180;&lt;br /&gt;
 ball_1.spdX = -155;&lt;br /&gt;
 ball_1.spdY = -155;&lt;br /&gt;
 ball_1.mass = 5 &amp;lt;&amp;lt; 8;&lt;br /&gt;
 ball_1.radius = 16;&lt;br /&gt;
 ball_1.cube = 0;&lt;br /&gt;
 ball_1.face = 0;&lt;br /&gt;
 ball_1.CoR = 150;&lt;br /&gt;
&lt;br /&gt;
2. Check collision of two circles and resolve it.&lt;br /&gt;
&lt;br /&gt;
 if (Physics_Circle_Vs_Circle_obj(ball_1, ball_2)) {&lt;br /&gt;
    // Resolve collision&lt;br /&gt;
    Physics_Res_CvC_Coll_Massless(ball_1, ball_2);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
3. Check collision of circle versus rectangle and resolve it.&lt;br /&gt;
&lt;br /&gt;
 new fakeCircle[PHYSICS_CIRCLE_DATA];&lt;br /&gt;
 if (Physics_Circle_vs_AABB_obj(ball, rectanglePosX, rectanglePosY, rectangleWidth, rectangleHeight, fakeCircle)) {&lt;br /&gt;
    // Resolve collision    &lt;br /&gt;
    Physics_Res_CvC_Coll_Mass(ball, fakeCircle);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
4. Sending and receiving circle object.&lt;br /&gt;
&lt;br /&gt;
 // Sending message with ball object&lt;br /&gt;
 SendBall (const pktNumber) {&lt;br /&gt;
    new data[4];&lt;br /&gt;
    new serializedData_1, serializedData_2;&lt;br /&gt;
    // Serialize 'ball' data&lt;br /&gt;
    Physics_SerializeCircle(ball, serializedData_1, serializedData_2);&lt;br /&gt;
    // Prepare message&lt;br /&gt;
    data[0] = P2P_CMD_SEND_BALL;&lt;br /&gt;
    data[1] = serializedData_1;&lt;br /&gt;
    data[2] = serializedData_2;&lt;br /&gt;
    data[3] = pktNumber;&lt;br /&gt;
    // Broadcast message&lt;br /&gt;
    abi_CMD_NET_TX(0, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(1, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(2, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 // Receiving message with ball object&lt;br /&gt;
 case P2P_CMD_SEND_BALL: {&lt;br /&gt;
    new packetNumberReceived = pkt[4];&lt;br /&gt;
    if ((ballPacketNumber &amp;lt; packetNumberReceived) || ((ballPacketNumber - packetNumberReceived) &amp;gt; (0x7FFFFFFF &amp;gt;&amp;gt; 1))) {&lt;br /&gt;
       ballPacketNumber = packetNumberReceived;&lt;br /&gt;
       Physics_DeserializeCircle(pkt[2], pkt[3], ball);&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=16505</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=16505"/>
		<updated>2022-02-11T06:47:09Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 256 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 256 bytes.&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[GAME_SAVE_SIZE];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[GAME_SAVE_SIZE - 1] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sound functions===&lt;br /&gt;
====abi_CMD_PLAYSND====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_PLAYSND(const id, const volume)&lt;br /&gt;
Description:&lt;br /&gt;
: Play chosen sound with a given volume.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''id''&lt;br /&gt;
:: Sound serial number in the application package.&lt;br /&gt;
: ''volume''&lt;br /&gt;
:: The sound volume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
====abi_CMD_NET_TX====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_NET_TX(const line_tx, const TTL, const data[])&lt;br /&gt;
Description:&lt;br /&gt;
: Send data through given UART line with given TTL.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''line_tx''&lt;br /&gt;
:: UART line for sending a message. Each module has 3 UART lines.&lt;br /&gt;
: ''TTL''&lt;br /&gt;
:: Message time to live. How many modules message will pass through before stopping. For example, set TTL to 0 message will transfer only to the neighbor module. Set TTL to 1 message will transfer to a neighbor of neighbor. Maximum TTL is 2.&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Data array to send. Maximum can be sent 20 bytes. The first 4 bytes are message general information that automatically adds before sending. The maximum useful data that can be sent are 16 bytes. Taking into account net command name 15 bytes.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
We want to receive data only from 0 module&lt;br /&gt;
&lt;br /&gt;
 // define net command&lt;br /&gt;
 #define NEW_TEST_NET_COMMAND P2P_CMD_BASE_SCRIPT_1 + 1&lt;br /&gt;
 &lt;br /&gt;
 // create message to send&lt;br /&gt;
 Send_Test_Message() {&lt;br /&gt;
    new data[4];&lt;br /&gt;
    data[0] = NEW_TEST_NET_COMMAND | (abi_cubeN &amp;lt;&amp;lt; 8);&lt;br /&gt;
    data[1] = add_game_data;&lt;br /&gt;
    // using bitwise operations send more data&lt;br /&gt;
    data[2] = add_script_data_1 | (add_script_data_2 &amp;lt;&amp;lt; 8) | (add_script_data_3 &amp;lt;&amp;lt; 16) | (add_script_data_4 &amp;lt;&amp;lt; 24);&lt;br /&gt;
    data[3] = add_game_data_1 | (add_game_data_2 &amp;lt;&amp;lt; 16);&lt;br /&gt;
    &lt;br /&gt;
    // send message through UART&lt;br /&gt;
    abi_CMD_NET_TX(0, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(1, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(2, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // process the received message&lt;br /&gt;
 ON_CMD_NET_RX (const pkt[]) {&lt;br /&gt;
    // get 4 byte from incoming packet to get net command because first 4 bytes are general info&lt;br /&gt;
    switch (abi_ByteN(pkt, 4)) {&lt;br /&gt;
        case NEW_TEST_NET_COMMAND: {&lt;br /&gt;
            if (abi_ByteN(pkt, 5) == 0) {&lt;br /&gt;
                game_data = pkt[2];&lt;br /&gt;
                script_data_1 = abi_ByteN(pkt, 12);&lt;br /&gt;
                script_data_2 = abi_ByteN(pkt, 13);&lt;br /&gt;
                script_data_3 = abi_ByteN(pkt, 14);&lt;br /&gt;
                script_data_4 = abi_ByteN(pkt, 15);&lt;br /&gt;
                game_data_1 = pkt[4] &amp;amp; 0xFFFF;&lt;br /&gt;
                game_data_2 = (pkt[4] &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Physics functions===&lt;br /&gt;
====PHYSICS_CIRCLE_DATA====&lt;br /&gt;
Syntax:&lt;br /&gt;
  #define PHYSICS_CIRCLE_DATA .posX, .posY, .simplePosX, .simplePosY, .spdX, .spdY, .mass, .radius, .CoR, .cube, .face, .cubeT, .faceT&lt;br /&gt;
Description:&lt;br /&gt;
: PAWN symbolic subscript which represent stucture.&lt;br /&gt;
Fields&lt;br /&gt;
: ''posX''&lt;br /&gt;
:: Circle position on X axis (fixed point)&lt;br /&gt;
: ''posY''&lt;br /&gt;
:: Circle position on Y axis (fixed point)&lt;br /&gt;
: ''simplePosX''&lt;br /&gt;
:: Circle position on X axis&lt;br /&gt;
: ''simplePosY''&lt;br /&gt;
:: Circle position on Y axis&lt;br /&gt;
: ''spdX''&lt;br /&gt;
:: Circle X speed&lt;br /&gt;
: ''spdY''&lt;br /&gt;
:: Circle Y speed&lt;br /&gt;
: ''mass''&lt;br /&gt;
:: Circle mass (fixed point)&lt;br /&gt;
: ''radius''&lt;br /&gt;
:: Circle radius&lt;br /&gt;
: ''CoR''&lt;br /&gt;
:: Coefficient of restitution (fixed point)&lt;br /&gt;
: ''cube''&lt;br /&gt;
:: Module owner of this circle&lt;br /&gt;
: ''face''&lt;br /&gt;
:: Face owner of this circle&lt;br /&gt;
: ''cubeT''&lt;br /&gt;
:: Cube transfer, last module owner. Can be used for resending messages&lt;br /&gt;
: ''faceT''&lt;br /&gt;
:: Face transfer, last face owner. Can be used for resending messages&lt;br /&gt;
&lt;br /&gt;
====Physics_Circle_Vs_Circle_obj====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Circle_Vs_Circle_obj(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Check circle versus circle collision.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle1&lt;br /&gt;
:: First circle object.&lt;br /&gt;
: circle2&lt;br /&gt;
:: Second circle object.&lt;br /&gt;
&lt;br /&gt;
====Physics_Circle_vs_AABB_obj====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Circle_vs_AABB_obj(circle[PHYSICS_CIRCLE_DATA], rectX, rectY, rectWidth, rectHeight, fakeCircle[PHYSICS_CIRCLE_DATA] = 0)&lt;br /&gt;
Description:&lt;br /&gt;
: Check circle versus rectangle collision.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object.&lt;br /&gt;
: rectX&lt;br /&gt;
:: Rectangle X coordinate.&lt;br /&gt;
: rectY&lt;br /&gt;
:: Rectangle Y coordinate.&lt;br /&gt;
: rectWidth&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: rectHeight&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: fakeCircle&lt;br /&gt;
:: In case of collision returns the collision point.&lt;br /&gt;
&lt;br /&gt;
====Physics_Circle_Vs_LineSegment====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Circle_Vs_LineSegment(circle[PHYSICS_CIRCLE_DATA], lineSX, lineSY, lineEX, lineEY, fakeCircle[PHYSICS_CIRCLE_DATA] = 0)&lt;br /&gt;
Description:&lt;br /&gt;
: Check circle versus line segment collision.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object.&lt;br /&gt;
: lineSX&lt;br /&gt;
:: Line start X coordinates.&lt;br /&gt;
: lineSY&lt;br /&gt;
:: Line start Y coordinate.&lt;br /&gt;
: lineEX&lt;br /&gt;
:: Line end X coordinate.&lt;br /&gt;
: lineEY&lt;br /&gt;
:: Line end Y coordinate.&lt;br /&gt;
: fakeCircle&lt;br /&gt;
:: In case of collision returns the collision point.&lt;br /&gt;
&lt;br /&gt;
====Physics_Res_CvC_Coll_Massless====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Res_CvC_Coll_Massless(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Collision resolves without using object mass.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle1&lt;br /&gt;
:: First circle object.&lt;br /&gt;
: circle2&lt;br /&gt;
:: Second circle object.&lt;br /&gt;
&lt;br /&gt;
====Physics_Res_CvC_Coll_Mass====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Res_CvC_Coll_Mass(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Resolves collision using object mass.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle1&lt;br /&gt;
:: First circle object.&lt;br /&gt;
: circle2&lt;br /&gt;
:: Second circle object.&lt;br /&gt;
&lt;br /&gt;
====Physics_DeserializeCircle====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_DeserializeCircle(serializedData_1, serializedData_2, circle[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Deserialize circle object.&lt;br /&gt;
Arguments:&lt;br /&gt;
: serializedData_1&lt;br /&gt;
:: First part of serialized circle data.&lt;br /&gt;
: serializedData_2&lt;br /&gt;
:: Second part of serialized circle data.&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object where need to save deserialized data.&lt;br /&gt;
&lt;br /&gt;
====Physics_SerializeCircle====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_SerializeCircle(obj[PHYSICS_CIRCLE_DATA], &amp;amp;serializedData_1, &amp;amp;serializedData_2)&lt;br /&gt;
Description:&lt;br /&gt;
: Serialize circle object.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object to serialize.&lt;br /&gt;
: serializedData_1&lt;br /&gt;
:: Return first part of serialized circle data.&lt;br /&gt;
: serializedData_2&lt;br /&gt;
:: Return second part of serialized circle data.&lt;br /&gt;
&lt;br /&gt;
====Physics_Overlap====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Overlap(overlap, positionDifference, distance)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the distance by which objects overlap.&lt;br /&gt;
Arguments:&lt;br /&gt;
: overlap&lt;br /&gt;
:: Half distance between two points.&lt;br /&gt;
: positionDifference&lt;br /&gt;
:: Position difference between two point in one axis. Example - first point position X is 10, second is 6. Then position difference is 10-6=4.&lt;br /&gt;
: distance&lt;br /&gt;
:: Distance between two points.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Create circle object.&lt;br /&gt;
 &lt;br /&gt;
 new ball_1[PHYSICS_CIRCLE_DATA];&lt;br /&gt;
 ball_1.posX = 180 &amp;lt;&amp;lt; 8;&lt;br /&gt;
 ball_1.posY = 180 &amp;lt;&amp;lt; 8;&lt;br /&gt;
 ball_1.simplePosX = 200;&lt;br /&gt;
 ball_1.simplePosY = 180;&lt;br /&gt;
 ball_1.spdX = -155;&lt;br /&gt;
 ball_1.spdY = -155;&lt;br /&gt;
 ball_1.mass = 5 &amp;lt;&amp;lt; 8;&lt;br /&gt;
 ball_1.radius = 16;&lt;br /&gt;
 ball_1.cube = 0;&lt;br /&gt;
 ball_1.face = 0;&lt;br /&gt;
 ball_1.CoR = 150;&lt;br /&gt;
&lt;br /&gt;
2. Check collision of two circles and resolve it.&lt;br /&gt;
&lt;br /&gt;
 if (Physics_Circle_Vs_Circle_obj(ball_1, ball_2)) {&lt;br /&gt;
    // Resolve collision&lt;br /&gt;
    Physics_Res_CvC_Coll_Massless(ball_1, ball_2);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
3. Check collision of circle versus rectangle and resolve it.&lt;br /&gt;
&lt;br /&gt;
 new fakeCircle[PHYSICS_CIRCLE_DATA];&lt;br /&gt;
 if (Physics_Circle_vs_AABB_obj(ball, rectanglePosX, rectanglePosY, rectangleWidth, rectangleHeight, fakeCircle)) {&lt;br /&gt;
    // Resolve collision    &lt;br /&gt;
    Physics_Res_CvC_Coll_Mass(ball, fakeCircle);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
4. Sending and receiving circle object.&lt;br /&gt;
&lt;br /&gt;
 // Sending message with ball object&lt;br /&gt;
 SendBall (const pktNumber) {&lt;br /&gt;
    new data[4];&lt;br /&gt;
    new serializedData_1, serializedData_2;&lt;br /&gt;
    // Serialize 'ball' data&lt;br /&gt;
    Physics_SerializeCircle(ball, serializedData_1, serializedData_2);&lt;br /&gt;
    // Prepare message&lt;br /&gt;
    data[0] = P2P_CMD_SEND_BALL;&lt;br /&gt;
    data[1] = serializedData_1;&lt;br /&gt;
    data[2] = serializedData_2;&lt;br /&gt;
    data[3] = pktNumber;&lt;br /&gt;
    // Broadcast message&lt;br /&gt;
    abi_CMD_NET_TX(0, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(1, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(2, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 // Receiving message with ball object&lt;br /&gt;
 case P2P_CMD_SEND_BALL: {&lt;br /&gt;
    new packetNumberReceived = pkt[4];&lt;br /&gt;
    if ((ballPacketNumber &amp;lt; packetNumberReceived) || ((ballPacketNumber - packetNumberReceived) &amp;gt; (0x7FFFFFFF &amp;gt;&amp;gt; 1))) {&lt;br /&gt;
       ballPacketNumber = packetNumberReceived;&lt;br /&gt;
       Physics_DeserializeCircle(pkt[2], pkt[3], ball);&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=16504</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=16504"/>
		<updated>2022-02-10T13:48:12Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* Physics functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 256 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 256 bytes.&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[GAME_SAVE_SIZE];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[GAME_SAVE_SIZE - 1] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sound functions===&lt;br /&gt;
====abi_CMD_PLAYSND====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_PLAYSND(const id, const volume)&lt;br /&gt;
Description:&lt;br /&gt;
: Play chosen sound with a given volume.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''id''&lt;br /&gt;
:: Sound serial number in the application package.&lt;br /&gt;
: ''volume''&lt;br /&gt;
:: The sound volume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
====abi_CMD_NET_TX====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_NET_TX(const line_tx, const TTL, const data[])&lt;br /&gt;
Description:&lt;br /&gt;
: Send data through given UART line with given TTL.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''line_tx''&lt;br /&gt;
:: UART line for sending a message. Each module has 3 UART lines.&lt;br /&gt;
: ''TTL''&lt;br /&gt;
:: Message time to live. How many modules message will pass through before stopping. For example, set TTL to 0 message will transfer only to the neighbor module. Set TTL to 1 message will transfer to a neighbor of neighbor. Maximum TTL is 2.&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Data array to send. Maximum can be sent 20 bytes. The first 4 bytes are message general information that automatically adds before sending. The maximum useful data that can be sent are 16 bytes. Taking into account net command name 15 bytes.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
We want to receive data only from 0 module&lt;br /&gt;
&lt;br /&gt;
 // define net command&lt;br /&gt;
 #define NEW_TEST_NET_COMMAND P2P_CMD_BASE_SCRIPT_1 + 1&lt;br /&gt;
 &lt;br /&gt;
 // create message to send&lt;br /&gt;
 Send_Test_Message() {&lt;br /&gt;
    new data[4];&lt;br /&gt;
    data[0] = NEW_TEST_NET_COMMAND | (abi_cubeN &amp;lt;&amp;lt; 8);&lt;br /&gt;
    data[1] = add_game_data;&lt;br /&gt;
    // using bitwise operations send more data&lt;br /&gt;
    data[2] = add_script_data_1 | (add_script_data_2 &amp;lt;&amp;lt; 8) | (add_script_data_3 &amp;lt;&amp;lt; 16) | (add_script_data_4 &amp;lt;&amp;lt; 24);&lt;br /&gt;
    data[3] = add_game_data_1 | (add_game_data_2 &amp;lt;&amp;lt; 16);&lt;br /&gt;
    &lt;br /&gt;
    // send message through UART&lt;br /&gt;
    abi_CMD_NET_TX(0, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(1, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(2, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // process the received message&lt;br /&gt;
 ON_CMD_NET_RX (const pkt[]) {&lt;br /&gt;
    // get 4 byte from incoming packet to get net command because first 4 bytes are general info&lt;br /&gt;
    switch (abi_ByteN(pkt, 4)) {&lt;br /&gt;
        case NEW_TEST_NET_COMMAND: {&lt;br /&gt;
            if (abi_ByteN(pkt, 5) == 0) {&lt;br /&gt;
                game_data = pkt[2];&lt;br /&gt;
                script_data_1 = abi_ByteN(pkt, 12);&lt;br /&gt;
                script_data_2 = abi_ByteN(pkt, 13);&lt;br /&gt;
                script_data_3 = abi_ByteN(pkt, 14);&lt;br /&gt;
                script_data_4 = abi_ByteN(pkt, 15);&lt;br /&gt;
                game_data_1 = pkt[4] &amp;amp; 0xFFFF;&lt;br /&gt;
                game_data_2 = (pkt[4] &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Physics functions===&lt;br /&gt;
====PHYSICS_CIRCLE_DATA====&lt;br /&gt;
Syntax:&lt;br /&gt;
  #define PHYSICS_CIRCLE_DATA .posX, .posY, .simplePosX, .simplePosY, .spdX, .spdY, .mass, .radius, .CoR, .cube, .face, .cubeT, .faceT&lt;br /&gt;
Description:&lt;br /&gt;
: PAWN symbolic subscript which represent stucture.&lt;br /&gt;
Fields&lt;br /&gt;
: ''posX''&lt;br /&gt;
:: Circle position on X axis (fixed point)&lt;br /&gt;
: ''posY''&lt;br /&gt;
:: Circle position on Y axis (fixed point)&lt;br /&gt;
: ''simplePosX''&lt;br /&gt;
:: Circle position on X axis&lt;br /&gt;
: ''simplePosY''&lt;br /&gt;
:: Circle position on Y axis&lt;br /&gt;
: ''spdX''&lt;br /&gt;
:: Circle X speed&lt;br /&gt;
: ''spdY''&lt;br /&gt;
:: Circle Y speed&lt;br /&gt;
: ''mass''&lt;br /&gt;
:: Circle mass (fixed point)&lt;br /&gt;
: ''radius''&lt;br /&gt;
:: Circle radius&lt;br /&gt;
: ''CoR''&lt;br /&gt;
:: Coefficient of restitution (fixed point)&lt;br /&gt;
: ''cube''&lt;br /&gt;
:: Module owner of this circle&lt;br /&gt;
: ''face''&lt;br /&gt;
:: Face owner of this circle&lt;br /&gt;
: ''cubeT''&lt;br /&gt;
:: Cube transfer, last module owner. Can be used for resending messages&lt;br /&gt;
: ''faceT''&lt;br /&gt;
:: Face transfer, last face owner. Can be used for resending messages&lt;br /&gt;
&lt;br /&gt;
====Physics_Circle_Vs_Circle_obj====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Circle_Vs_Circle_obj(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Check circle versus circle collision.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle1&lt;br /&gt;
:: First circle object.&lt;br /&gt;
: circle2&lt;br /&gt;
:: Second circle object.&lt;br /&gt;
&lt;br /&gt;
====Physics_Circle_vs_AABB_obj====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Circle_vs_AABB_obj(circle[PHYSICS_CIRCLE_DATA], rectX, rectY, rectWidth, rectHeight, fakeCircle[PHYSICS_CIRCLE_DATA] = 0)&lt;br /&gt;
Description:&lt;br /&gt;
: Check circle versus rectangle collision.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object.&lt;br /&gt;
: rectX&lt;br /&gt;
:: Rectangle X coordinate.&lt;br /&gt;
: rectY&lt;br /&gt;
:: Rectangle Y coordinate.&lt;br /&gt;
: rectWidth&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: rectHeight&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: fakeCircle&lt;br /&gt;
:: In case of collision returns the collision point.&lt;br /&gt;
&lt;br /&gt;
====Physics_Circle_Vs_LineSegment====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Circle_Vs_LineSegment(circle[PHYSICS_CIRCLE_DATA], lineSX, lineSY, lineEX, lineEY, fakeCircle[PHYSICS_CIRCLE_DATA] = 0)&lt;br /&gt;
Description:&lt;br /&gt;
: Check circle versus line segment collision.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object.&lt;br /&gt;
: lineSX&lt;br /&gt;
:: Line start X coordinates.&lt;br /&gt;
: lineSY&lt;br /&gt;
:: Line start Y coordinate.&lt;br /&gt;
: lineEX&lt;br /&gt;
:: Line end X coordinate.&lt;br /&gt;
: lineEY&lt;br /&gt;
:: Line end Y coordinate.&lt;br /&gt;
: fakeCircle&lt;br /&gt;
:: In case of collision returns the collision point.&lt;br /&gt;
&lt;br /&gt;
====Physics_Res_CvC_Coll_Massless====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Res_CvC_Coll_Massless(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Collision resolves without using object mass.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle1&lt;br /&gt;
:: First circle object.&lt;br /&gt;
: circle2&lt;br /&gt;
:: Second circle object.&lt;br /&gt;
&lt;br /&gt;
====Physics_Res_CvC_Coll_Mass====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Res_CvC_Coll_Mass(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Resolves collision using object mass.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle1&lt;br /&gt;
:: First circle object.&lt;br /&gt;
: circle2&lt;br /&gt;
:: Second circle object.&lt;br /&gt;
&lt;br /&gt;
====Physics_DeserializeCircle====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_DeserializeCircle(serializedData_1, serializedData_2, circle[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Deserialize circle object.&lt;br /&gt;
Arguments:&lt;br /&gt;
: serializedData_1&lt;br /&gt;
:: First part of serialized circle data.&lt;br /&gt;
: serializedData_2&lt;br /&gt;
:: Second part of serialized circle data.&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object where need to save deserialized data.&lt;br /&gt;
&lt;br /&gt;
====Physics_SerializeCircle====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_SerializeCircle(obj[PHYSICS_CIRCLE_DATA], &amp;amp;serializedData_1, &amp;amp;serializedData_2)&lt;br /&gt;
Description:&lt;br /&gt;
: Serialize circle object.&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle&lt;br /&gt;
:: Circle object to serialize.&lt;br /&gt;
: serializedData_1&lt;br /&gt;
:: Return first part of serialized circle data.&lt;br /&gt;
: serializedData_2&lt;br /&gt;
:: Return second part of serialized circle data.&lt;br /&gt;
&lt;br /&gt;
====Physics_Overlap====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Overlap(overlap, positionDifference, distance)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the distance by which objects overlap.&lt;br /&gt;
Arguments:&lt;br /&gt;
: overlap&lt;br /&gt;
:: Half distance between two points.&lt;br /&gt;
: positionDifference&lt;br /&gt;
:: Position difference between two point in one axis. Example - first point position X is 10, second is 6. Then position difference is 10-6=4.&lt;br /&gt;
: distance&lt;br /&gt;
:: Distance between two points.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Create circle object.&lt;br /&gt;
 &lt;br /&gt;
 new ball_1[PHYSICS_CIRCLE_DATA];&lt;br /&gt;
 ball_1.posX = 180 &amp;lt;&amp;lt; 8;&lt;br /&gt;
 ball_1.posY = 180 &amp;lt;&amp;lt; 8;&lt;br /&gt;
 ball_1.simplePosX = 200;&lt;br /&gt;
 ball_1.simplePosY = 180;&lt;br /&gt;
 ball_1.spdX = -155;&lt;br /&gt;
 ball_1.spdY = -155;&lt;br /&gt;
 ball_1.mass = 5 &amp;lt;&amp;lt; 8;&lt;br /&gt;
 ball_1.radius = 16;&lt;br /&gt;
 ball_1.cube = 0;&lt;br /&gt;
 ball_1.face = 0;&lt;br /&gt;
 ball_1.CoR = 150;&lt;br /&gt;
&lt;br /&gt;
2. Check collision of two circles and resolve it.&lt;br /&gt;
&lt;br /&gt;
 if (Physics_Circle_Vs_Circle_obj(ball_1, ball_2)) {&lt;br /&gt;
    // Resolve collision&lt;br /&gt;
    Physics_Res_CvC_Coll_Massless(ball_1, ball_2);&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=16503</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=16503"/>
		<updated>2022-02-10T12:00:46Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* Messages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 256 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 256 bytes.&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[GAME_SAVE_SIZE];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[GAME_SAVE_SIZE - 1] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sound functions===&lt;br /&gt;
====abi_CMD_PLAYSND====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_PLAYSND(const id, const volume)&lt;br /&gt;
Description:&lt;br /&gt;
: Play chosen sound with a given volume.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''id''&lt;br /&gt;
:: Sound serial number in the application package.&lt;br /&gt;
: ''volume''&lt;br /&gt;
:: The sound volume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
====abi_CMD_NET_TX====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_NET_TX(const line_tx, const TTL, const data[])&lt;br /&gt;
Description:&lt;br /&gt;
: Send data through given UART line with given TTL.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''line_tx''&lt;br /&gt;
:: UART line for sending a message. Each module has 3 UART lines.&lt;br /&gt;
: ''TTL''&lt;br /&gt;
:: Message time to live. How many modules message will pass through before stopping. For example, set TTL to 0 message will transfer only to the neighbor module. Set TTL to 1 message will transfer to a neighbor of neighbor. Maximum TTL is 2.&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Data array to send. Maximum can be sent 20 bytes. The first 4 bytes are message general information that automatically adds before sending. The maximum useful data that can be sent are 16 bytes. Taking into account net command name 15 bytes.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
We want to receive data only from 0 module&lt;br /&gt;
&lt;br /&gt;
 // define net command&lt;br /&gt;
 #define NEW_TEST_NET_COMMAND P2P_CMD_BASE_SCRIPT_1 + 1&lt;br /&gt;
 &lt;br /&gt;
 // create message to send&lt;br /&gt;
 Send_Test_Message() {&lt;br /&gt;
    new data[4];&lt;br /&gt;
    data[0] = NEW_TEST_NET_COMMAND | (abi_cubeN &amp;lt;&amp;lt; 8);&lt;br /&gt;
    data[1] = add_game_data;&lt;br /&gt;
    // using bitwise operations send more data&lt;br /&gt;
    data[2] = add_script_data_1 | (add_script_data_2 &amp;lt;&amp;lt; 8) | (add_script_data_3 &amp;lt;&amp;lt; 16) | (add_script_data_4 &amp;lt;&amp;lt; 24);&lt;br /&gt;
    data[3] = add_game_data_1 | (add_game_data_2 &amp;lt;&amp;lt; 16);&lt;br /&gt;
    &lt;br /&gt;
    // send message through UART&lt;br /&gt;
    abi_CMD_NET_TX(0, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(1, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(2, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // process the received message&lt;br /&gt;
 ON_CMD_NET_RX (const pkt[]) {&lt;br /&gt;
    // get 4 byte from incoming packet to get net command because first 4 bytes are general info&lt;br /&gt;
    switch (abi_ByteN(pkt, 4)) {&lt;br /&gt;
        case NEW_TEST_NET_COMMAND: {&lt;br /&gt;
            if (abi_ByteN(pkt, 5) == 0) {&lt;br /&gt;
                game_data = pkt[2];&lt;br /&gt;
                script_data_1 = abi_ByteN(pkt, 12);&lt;br /&gt;
                script_data_2 = abi_ByteN(pkt, 13);&lt;br /&gt;
                script_data_3 = abi_ByteN(pkt, 14);&lt;br /&gt;
                script_data_4 = abi_ByteN(pkt, 15);&lt;br /&gt;
                game_data_1 = pkt[4] &amp;amp; 0xFFFF;&lt;br /&gt;
                game_data_2 = (pkt[4] &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Physics functions===&lt;br /&gt;
====PHYSICS_CIRCLE_DATA====&lt;br /&gt;
Syntax:&lt;br /&gt;
  #define PHYSICS_CIRCLE_DATA .posX, .posY, .simplePosX, .simplePosY, .spdX, .spdY, .mass, .radius, .CoR, .cube, .face, .cubeT, .faceT&lt;br /&gt;
Description:&lt;br /&gt;
: PAWN symbolic subscript which represent stucture.&lt;br /&gt;
Fields&lt;br /&gt;
: ''posX''&lt;br /&gt;
:: Circle position on X axis (fixed point)&lt;br /&gt;
: ''posY''&lt;br /&gt;
:: Circle position on Y axis (fixed point)&lt;br /&gt;
: ''simplePosX''&lt;br /&gt;
:: Circle position on X axis&lt;br /&gt;
: ''simplePosY''&lt;br /&gt;
:: Circle position on Y axis&lt;br /&gt;
: ''spdX''&lt;br /&gt;
:: Circle X speed&lt;br /&gt;
: ''spdY''&lt;br /&gt;
:: Circle Y speed&lt;br /&gt;
: ''mass''&lt;br /&gt;
:: Circle mass (fixed point)&lt;br /&gt;
: ''radius''&lt;br /&gt;
:: Circle radius&lt;br /&gt;
: ''CoR''&lt;br /&gt;
:: Coefficient of restitution (fixed point)&lt;br /&gt;
: ''cube''&lt;br /&gt;
:: Module owner of this circle&lt;br /&gt;
: ''face''&lt;br /&gt;
:: Face owner of this circle&lt;br /&gt;
: ''cubeT''&lt;br /&gt;
:: Cube transfer, last module owner. Can be used for resending messages&lt;br /&gt;
: ''faceT''&lt;br /&gt;
:: Face transfer, last face owner. Can be used for resending messages&lt;br /&gt;
&lt;br /&gt;
====Physics_Circle_Vs_Circle_obj====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Circle_Vs_Circle_obj(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Check if two circles collide&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle1&lt;br /&gt;
:: First circle object.&lt;br /&gt;
: circle2&lt;br /&gt;
:: Second circle object.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=16502</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=16502"/>
		<updated>2022-02-10T12:00:09Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* Physics functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 256 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 256 bytes.&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[GAME_SAVE_SIZE];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[GAME_SAVE_SIZE - 1] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sound functions===&lt;br /&gt;
====abi_CMD_PLAYSND====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_PLAYSND(const id, const volume)&lt;br /&gt;
Description:&lt;br /&gt;
: Play chosen sound with a given volume.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''id''&lt;br /&gt;
:: Sound serial number in the application package.&lt;br /&gt;
: ''volume''&lt;br /&gt;
:: The sound volume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
====abi_CMD_NET_TX====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_NET_TX(const line_tx, const TTL, const data[])&lt;br /&gt;
Description:&lt;br /&gt;
: Send data through given UART line with given TTL. Ge&lt;br /&gt;
Arguments&lt;br /&gt;
: ''line_tx''&lt;br /&gt;
:: UART line for sending a message. Each module has 3 UART lines.&lt;br /&gt;
: ''TTL''&lt;br /&gt;
:: Message time to live. How many modules message will pass through before stopping. For example, set TTL to 0 message will transfer only to the neighbor module. Set TTL to 1 message will transfer to a neighbor of neighbor. Maximum TTL is 2.&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Data array to send. Maximum can be sent 20 bytes. The first 4 bytes are message general information that automatically adds before sending. The maximum useful data that can be sent are 16 bytes. Taking into account net command name 15 bytes.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
We want to receive data only from 0 module&lt;br /&gt;
&lt;br /&gt;
 // define net command&lt;br /&gt;
 #define NEW_TEST_NET_COMMAND P2P_CMD_BASE_SCRIPT_1 + 1&lt;br /&gt;
 &lt;br /&gt;
 // create message to send&lt;br /&gt;
 Send_Test_Message() {&lt;br /&gt;
    new data[4];&lt;br /&gt;
    data[0] = NEW_TEST_NET_COMMAND | (abi_cubeN &amp;lt;&amp;lt; 8);&lt;br /&gt;
    data[1] = add_game_data;&lt;br /&gt;
    // using bitwise operations send more data&lt;br /&gt;
    data[2] = add_script_data_1 | (add_script_data_2 &amp;lt;&amp;lt; 8) | (add_script_data_3 &amp;lt;&amp;lt; 16) | (add_script_data_4 &amp;lt;&amp;lt; 24);&lt;br /&gt;
    data[3] = add_game_data_1 | (add_game_data_2 &amp;lt;&amp;lt; 16);&lt;br /&gt;
    &lt;br /&gt;
    // send message through UART&lt;br /&gt;
    abi_CMD_NET_TX(0, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(1, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(2, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // process the received message&lt;br /&gt;
 ON_CMD_NET_RX (const pkt[]) {&lt;br /&gt;
    // get 4 byte from incoming packet to get net command because first 4 bytes are general info&lt;br /&gt;
    switch (abi_ByteN(pkt, 4)) {&lt;br /&gt;
        case NEW_TEST_NET_COMMAND: {&lt;br /&gt;
            if (abi_ByteN(pkt, 5) == 0) {&lt;br /&gt;
                game_data = pkt[2];&lt;br /&gt;
                script_data_1 = abi_ByteN(pkt, 12);&lt;br /&gt;
                script_data_2 = abi_ByteN(pkt, 13);&lt;br /&gt;
                script_data_3 = abi_ByteN(pkt, 14);&lt;br /&gt;
                script_data_4 = abi_ByteN(pkt, 15);&lt;br /&gt;
                game_data_1 = pkt[4] &amp;amp; 0xFFFF;&lt;br /&gt;
                game_data_2 = (pkt[4] &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Physics functions===&lt;br /&gt;
====PHYSICS_CIRCLE_DATA====&lt;br /&gt;
Syntax:&lt;br /&gt;
  #define PHYSICS_CIRCLE_DATA .posX, .posY, .simplePosX, .simplePosY, .spdX, .spdY, .mass, .radius, .CoR, .cube, .face, .cubeT, .faceT&lt;br /&gt;
Description:&lt;br /&gt;
: PAWN symbolic subscript which represent stucture.&lt;br /&gt;
Fields&lt;br /&gt;
: ''posX''&lt;br /&gt;
:: Circle position on X axis (fixed point)&lt;br /&gt;
: ''posY''&lt;br /&gt;
:: Circle position on Y axis (fixed point)&lt;br /&gt;
: ''simplePosX''&lt;br /&gt;
:: Circle position on X axis&lt;br /&gt;
: ''simplePosY''&lt;br /&gt;
:: Circle position on Y axis&lt;br /&gt;
: ''spdX''&lt;br /&gt;
:: Circle X speed&lt;br /&gt;
: ''spdY''&lt;br /&gt;
:: Circle Y speed&lt;br /&gt;
: ''mass''&lt;br /&gt;
:: Circle mass (fixed point)&lt;br /&gt;
: ''radius''&lt;br /&gt;
:: Circle radius&lt;br /&gt;
: ''CoR''&lt;br /&gt;
:: Coefficient of restitution (fixed point)&lt;br /&gt;
: ''cube''&lt;br /&gt;
:: Module owner of this circle&lt;br /&gt;
: ''face''&lt;br /&gt;
:: Face owner of this circle&lt;br /&gt;
: ''cubeT''&lt;br /&gt;
:: Cube transfer, last module owner. Can be used for resending messages&lt;br /&gt;
: ''faceT''&lt;br /&gt;
:: Face transfer, last face owner. Can be used for resending messages&lt;br /&gt;
&lt;br /&gt;
====Physics_Circle_Vs_Circle_obj====&lt;br /&gt;
Syntax:&lt;br /&gt;
  Physics_Circle_Vs_Circle_obj(circle1[PHYSICS_CIRCLE_DATA], circle2[PHYSICS_CIRCLE_DATA])&lt;br /&gt;
Description:&lt;br /&gt;
: Check if two circles collide&lt;br /&gt;
Arguments:&lt;br /&gt;
: circle1&lt;br /&gt;
:: First circle object.&lt;br /&gt;
: circle2&lt;br /&gt;
:: Second circle object.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=16501</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=16501"/>
		<updated>2022-02-10T11:53:53Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 256 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 256 bytes.&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[GAME_SAVE_SIZE];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[GAME_SAVE_SIZE - 1] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sound functions===&lt;br /&gt;
====abi_CMD_PLAYSND====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_PLAYSND(const id, const volume)&lt;br /&gt;
Description:&lt;br /&gt;
: Play chosen sound with a given volume.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''id''&lt;br /&gt;
:: Sound serial number in the application package.&lt;br /&gt;
: ''volume''&lt;br /&gt;
:: The sound volume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
====abi_CMD_NET_TX====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_NET_TX(const line_tx, const TTL, const data[])&lt;br /&gt;
Description:&lt;br /&gt;
: Send data through given UART line with given TTL. Ge&lt;br /&gt;
Arguments&lt;br /&gt;
: ''line_tx''&lt;br /&gt;
:: UART line for sending a message. Each module has 3 UART lines.&lt;br /&gt;
: ''TTL''&lt;br /&gt;
:: Message time to live. How many modules message will pass through before stopping. For example, set TTL to 0 message will transfer only to the neighbor module. Set TTL to 1 message will transfer to a neighbor of neighbor. Maximum TTL is 2.&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Data array to send. Maximum can be sent 20 bytes. The first 4 bytes are message general information that automatically adds before sending. The maximum useful data that can be sent are 16 bytes. Taking into account net command name 15 bytes.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
We want to receive data only from 0 module&lt;br /&gt;
&lt;br /&gt;
 // define net command&lt;br /&gt;
 #define NEW_TEST_NET_COMMAND P2P_CMD_BASE_SCRIPT_1 + 1&lt;br /&gt;
 &lt;br /&gt;
 // create message to send&lt;br /&gt;
 Send_Test_Message() {&lt;br /&gt;
    new data[4];&lt;br /&gt;
    data[0] = NEW_TEST_NET_COMMAND | (abi_cubeN &amp;lt;&amp;lt; 8);&lt;br /&gt;
    data[1] = add_game_data;&lt;br /&gt;
    // using bitwise operations send more data&lt;br /&gt;
    data[2] = add_script_data_1 | (add_script_data_2 &amp;lt;&amp;lt; 8) | (add_script_data_3 &amp;lt;&amp;lt; 16) | (add_script_data_4 &amp;lt;&amp;lt; 24);&lt;br /&gt;
    data[3] = add_game_data_1 | (add_game_data_2 &amp;lt;&amp;lt; 16);&lt;br /&gt;
    &lt;br /&gt;
    // send message through UART&lt;br /&gt;
    abi_CMD_NET_TX(0, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(1, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(2, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // process the received message&lt;br /&gt;
 ON_CMD_NET_RX (const pkt[]) {&lt;br /&gt;
    // get 4 byte from incoming packet to get net command because first 4 bytes are general info&lt;br /&gt;
    switch (abi_ByteN(pkt, 4)) {&lt;br /&gt;
        case NEW_TEST_NET_COMMAND: {&lt;br /&gt;
            if (abi_ByteN(pkt, 5) == 0) {&lt;br /&gt;
                game_data = pkt[2];&lt;br /&gt;
                script_data_1 = abi_ByteN(pkt, 12);&lt;br /&gt;
                script_data_2 = abi_ByteN(pkt, 13);&lt;br /&gt;
                script_data_3 = abi_ByteN(pkt, 14);&lt;br /&gt;
                script_data_4 = abi_ByteN(pkt, 15);&lt;br /&gt;
                game_data_1 = pkt[4] &amp;amp; 0xFFFF;&lt;br /&gt;
                game_data_2 = (pkt[4] &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Physics functions===&lt;br /&gt;
====PHYSICS_CIRCLE_DATA====&lt;br /&gt;
Syntax:&lt;br /&gt;
  #define PHYSICS_CIRCLE_DATA .posX, .posY, .simplePosX, .simplePosY, .spdX, .spdY, .mass, .radius, .CoR, .cube, .face, .cubeT, .faceT&lt;br /&gt;
Description:&lt;br /&gt;
: PAWN symbolic subscript which represent stucture.&lt;br /&gt;
Fields&lt;br /&gt;
: ''posX''&lt;br /&gt;
:: Circle position on X axis (fixed point)&lt;br /&gt;
: ''posY''&lt;br /&gt;
:: Circle position on Y axis (fixed point)&lt;br /&gt;
: ''simplePosX''&lt;br /&gt;
:: Circle position on X axis&lt;br /&gt;
: ''simplePosY''&lt;br /&gt;
:: Circle position on Y axis&lt;br /&gt;
: ''spdX''&lt;br /&gt;
:: Circle X speed&lt;br /&gt;
: ''spdY''&lt;br /&gt;
:: Circle Y speed&lt;br /&gt;
: ''mass''&lt;br /&gt;
:: Circle mass (fixed point)&lt;br /&gt;
: ''radius''&lt;br /&gt;
:: Circle radius&lt;br /&gt;
: ''CoR''&lt;br /&gt;
:: Coefficient of restitution (fixed point)&lt;br /&gt;
: ''cube''&lt;br /&gt;
:: Module owner of this circle&lt;br /&gt;
: ''face''&lt;br /&gt;
:: Face owner of this circle&lt;br /&gt;
: ''cubeT''&lt;br /&gt;
:: Cube transfer, last module owner. Can be used for resending messages&lt;br /&gt;
: ''faceT''&lt;br /&gt;
:: Face transfer, last face owner. Can be used for resending messages&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=181</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=181"/>
		<updated>2021-07-30T09:43:58Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 256 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 256 bytes.&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[GAME_SAVE_SIZE];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[GAME_SAVE_SIZE - 1] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sound functions===&lt;br /&gt;
====abi_CMD_PLAYSND====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_PLAYSND(const id, const volume)&lt;br /&gt;
Description:&lt;br /&gt;
: Play chosen sound with a given volume.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''id''&lt;br /&gt;
:: Sound serial number in the application package.&lt;br /&gt;
: ''volume''&lt;br /&gt;
:: The sound volume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
====abi_CMD_NET_TX====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_NET_TX(const line_tx, const TTL, const data[])&lt;br /&gt;
Description:&lt;br /&gt;
: Send data through given UART line with given TTL. Ge&lt;br /&gt;
Arguments&lt;br /&gt;
: ''line_tx''&lt;br /&gt;
:: UART line for sending a message. Each module has 3 UART lines.&lt;br /&gt;
: ''TTL''&lt;br /&gt;
:: Message time to live. How many modules message will pass through before stopping. For example, set TTL to 0 message will transfer only to the neighbor module. Set TTL to 1 message will transfer to a neighbor of neighbor. Maximum TTL is 2.&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Data array to send. Maximum can be sent 20 bytes. The first 4 bytes are message general information that automatically adds before sending. The maximum useful data that can be sent are 16 bytes. Taking into account net command name 15 bytes.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
We want to receive data only from 0 module&lt;br /&gt;
&lt;br /&gt;
 // define net command&lt;br /&gt;
 #define NEW_TEST_NET_COMMAND P2P_CMD_BASE_SCRIPT_1 + 1&lt;br /&gt;
 &lt;br /&gt;
 // create message to send&lt;br /&gt;
 Send_Test_Message() {&lt;br /&gt;
    new data[4];&lt;br /&gt;
    data[0] = NEW_TEST_NET_COMMAND | (abi_cubeN &amp;lt;&amp;lt; 8);&lt;br /&gt;
    data[1] = add_game_data;&lt;br /&gt;
    // using bitwise operations send more data&lt;br /&gt;
    data[2] = add_script_data_1 | (add_script_data_2 &amp;lt;&amp;lt; 8) | (add_script_data_3 &amp;lt;&amp;lt; 16) | (add_script_data_4 &amp;lt;&amp;lt; 24);&lt;br /&gt;
    data[3] = add_game_data_1 | (add_game_data_2 &amp;lt;&amp;lt; 16);&lt;br /&gt;
    &lt;br /&gt;
    // send message through UART&lt;br /&gt;
    abi_CMD_NET_TX(0, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(1, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(2, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // process the received message&lt;br /&gt;
 ON_CMD_NET_RX (const pkt[]) {&lt;br /&gt;
    // get 4 byte from incoming packet to get net command because first 4 bytes are general info&lt;br /&gt;
    switch (abi_ByteN(pkt, 4)) {&lt;br /&gt;
        case NEW_TEST_NET_COMMAND: {&lt;br /&gt;
            if (abi_ByteN(pkt, 5) == 0) {&lt;br /&gt;
                game_data = pkt[2];&lt;br /&gt;
                script_data_1 = abi_ByteN(pkt, 12);&lt;br /&gt;
                script_data_2 = abi_ByteN(pkt, 13);&lt;br /&gt;
                script_data_3 = abi_ByteN(pkt, 14);&lt;br /&gt;
                script_data_4 = abi_ByteN(pkt, 15);&lt;br /&gt;
                game_data_1 = pkt[4] &amp;amp; 0xFFFF;&lt;br /&gt;
                game_data_2 = (pkt[4] &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=180</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=180"/>
		<updated>2021-07-30T09:30:57Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 256 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 256 bytes.&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[GAME_SAVE_SIZE];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[GAME_SAVE_SIZE - 1] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sound functions===&lt;br /&gt;
====abi_CMD_PLAYSND====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_PLAYSND(const id, const volume)&lt;br /&gt;
Description:&lt;br /&gt;
: Play chosen sound with a given volume.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''id''&lt;br /&gt;
:: Sound serial number in the application package.&lt;br /&gt;
: ''volume''&lt;br /&gt;
:: The sound volume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
====abi_CMD_NET_TX====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_NET_TX(const line_tx, const TTL, const data[])&lt;br /&gt;
Description:&lt;br /&gt;
: Send data through given UART line with given TTL. Ge&lt;br /&gt;
Arguments&lt;br /&gt;
: ''line_tx''&lt;br /&gt;
:: UART line for sending a message. Each module has 3 UART lines.&lt;br /&gt;
: ''TTL''&lt;br /&gt;
:: Message time to live. How many modules message will pass through before stopping. For example, set TTL to 0 message will transfer only to the neighbor module. Set TTL to 1 message will transfer to a neighbor of neighbor. Maximum TTL is 2.&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Data array to send. Maximum can be sent 20 bytes. The first 4 bytes are message general information that automatically adds before sending. The maximum useful data that can be sent are 16 bytes. Taking into account net command name 15 bytes.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 // define net command&lt;br /&gt;
 #define NEW_TEST_NET_COMMAND P2P_CMD_BASE_SCRIPT_1 + 1&lt;br /&gt;
 &lt;br /&gt;
 // create message to send&lt;br /&gt;
 Send_Test_Message() {&lt;br /&gt;
    new data[4];&lt;br /&gt;
    data[0] = NEW_TEST_NET_COMMAND | (abi_cubeN &amp;lt;&amp;lt; 8);&lt;br /&gt;
    data[1] = add_game_data;&lt;br /&gt;
    // using bitwise operations send more data&lt;br /&gt;
    data[2] = add_script_data_1 | (add_script_data_2 &amp;lt;&amp;lt; 8) | (add_script_data_3 &amp;lt;&amp;lt; 16) | (add_script_data_4 &amp;lt;&amp;lt; 24);&lt;br /&gt;
    data[3] = add_game_data_1 | (add_game_data_2 &amp;lt;&amp;lt; 16);&lt;br /&gt;
    &lt;br /&gt;
    // send message through UART&lt;br /&gt;
    abi_CMD_NET_TX(0, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(1, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
    abi_CMD_NET_TX(2, NET_BROADCAST_TTL_MAX, data);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // process the received message&lt;br /&gt;
 ON_CMD_NET_RX (const pkt[]) {&lt;br /&gt;
    // get 4 byte from incoming packet to get net command because first 4 bytes are general info&lt;br /&gt;
    switch (abi_ByteN(pkt, 4)) {&lt;br /&gt;
        case NEW_TEST_NET_COMMAND: {&lt;br /&gt;
            if (abi_ByteN(pkt, 5) == 0) {&lt;br /&gt;
                game_data = pkt[2];&lt;br /&gt;
                script_data_1 = abi_ByteN(pkt, 12);&lt;br /&gt;
                script_data_2 = abi_ByteN(pkt, 13);&lt;br /&gt;
                script_data_3 = abi_ByteN(pkt, 14);&lt;br /&gt;
                script_data_4 = abi_ByteN(pkt, 15);&lt;br /&gt;
                game_data_1 = pkt[4] &amp;amp; 0xFFFF;&lt;br /&gt;
                game_data_2 = (pkt[4] &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=177</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=177"/>
		<updated>2021-06-22T11:51:37Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* General settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete.&lt;br /&gt;
[[File:Highlight_Latest_Python_3_Release_link.png]]&lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
[[File:Python_installation_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
[[File:Python_disable_path_length_limit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing libraries'''&lt;br /&gt;
&lt;br /&gt;
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.&lt;br /&gt;
&lt;br /&gt;
[[File:Start_menu_with_PowerShell.png]]&lt;br /&gt;
&lt;br /&gt;
Type command &amp;quot;pip install intelhex pillow&amp;quot; and press enter. &lt;br /&gt;
[[File:Intelhex_and_pillow_installation.png]]&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
''pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow''&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file, drag the WOWCube Emulator application into the Applications folder. &lt;br /&gt;
[[File:Installation_on_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application.&lt;br /&gt;
[[File:Error_message_macOS_emulator_installation.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Terminal_window_in_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
In the terminal, write the command ''/ Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube'' and press enter.&lt;br /&gt;
&lt;br /&gt;
If the following error occurs&lt;br /&gt;
&lt;br /&gt;
''/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube''&lt;br /&gt;
&lt;br /&gt;
Then run the following command ''xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/''. It will output errors Permission Denied, but they are expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
For macOS version below Catalina open a terminal, install and download Homebrew&lt;br /&gt;
&lt;br /&gt;
''/ bin / bash -c &amp;quot;$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Homebrew is a package manager that lets you install Open Source applications.&lt;br /&gt;
&lt;br /&gt;
Next, install Python 3 and Pip&lt;br /&gt;
&lt;br /&gt;
''brew install python3''&lt;br /&gt;
&lt;br /&gt;
''brew cask install python3''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.&lt;br /&gt;
&lt;br /&gt;
''python3 -V''&lt;br /&gt;
&lt;br /&gt;
This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute&lt;br /&gt;
&lt;br /&gt;
''python -V''&lt;br /&gt;
&lt;br /&gt;
If it displays “Python 2.x.x”, then Python 3 is not installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install pip:&lt;br /&gt;
&lt;br /&gt;
''curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3''&lt;br /&gt;
&lt;br /&gt;
[[File:Check_for_python_and_installing_pip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing labraries'''&lt;br /&gt;
&lt;br /&gt;
Install IntelHex and Pillow libraries.&lt;br /&gt;
&lt;br /&gt;
''pip3 install pillow intelhex''&lt;br /&gt;
&lt;br /&gt;
==Starting WOWCube Emulator==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator by clicking on shortcut on desktop.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_shortcut_windows.png]]&lt;br /&gt;
&lt;br /&gt;
On first launch, a warning from the firewall will appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_security_alert_first_emulator_launch.png]]&lt;br /&gt;
&lt;br /&gt;
Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open terminal and enter ''WOWCube Emulator'' then and press Enter.&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator interface==&lt;br /&gt;
&lt;br /&gt;
===General view===&lt;br /&gt;
&lt;br /&gt;
There are 4 main groups of widgets in the WOWCube Emulator interface.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_UI.png]]&lt;br /&gt;
&lt;br /&gt;
===Cube model interactions===&lt;br /&gt;
&lt;br /&gt;
Contains links for interacting with the cube module. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* simulates the shaking of a cube&lt;br /&gt;
* returns the cube module to its original state (restoring rotations and position)&lt;br /&gt;
* open code redactor (does not work in version 2.2.0 and below)&lt;br /&gt;
* rotates a random side of the cube&lt;br /&gt;
&lt;br /&gt;
===Emulation progress control===&lt;br /&gt;
&lt;br /&gt;
Serves to interact with the progress of the script. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* start emulation of the selected pawn script. Аfter startup is replaced by the emulation restart button&lt;br /&gt;
* stops pawn script emulation&lt;br /&gt;
* loading a script to a physical cube using the bluetooth protocol (does not work in version 2.2.0 and below)&lt;br /&gt;
&lt;br /&gt;
===General settings===&lt;br /&gt;
&lt;br /&gt;
====Project tab====&lt;br /&gt;
&lt;br /&gt;
In this tab you can choose one of two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* Pawn;&lt;br /&gt;
* Projector.&lt;br /&gt;
 &lt;br /&gt;
''Projector mode''&lt;br /&gt;
&lt;br /&gt;
The projector is used to transfer images from a computer or mobile device to the WOWCube via the Bluetooth protocol.&lt;br /&gt;
&lt;br /&gt;
The projector in the WOWCube Emulator is used for prototyping and faster development of web-projector applications.&lt;br /&gt;
&lt;br /&gt;
''Pawn Mode''&lt;br /&gt;
&lt;br /&gt;
In this mode, you can:&lt;br /&gt;
&lt;br /&gt;
* select the path to the projects folder&lt;br /&gt;
* select a startup project&lt;br /&gt;
* view additional data for a running project&lt;br /&gt;
&lt;br /&gt;
====View tab====&lt;br /&gt;
&lt;br /&gt;
The Sound adjusts the overall volume.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_sound.png]]&lt;br /&gt;
&lt;br /&gt;
In the Emulation, the transparency of the overlay is adjusted. The overlay displays on each module its current number, screen and adjacent modules.&lt;br /&gt;
&lt;br /&gt;
The Limit FPS slider allows you to limit the frame rate in the application running on the emulator.&lt;br /&gt;
&lt;br /&gt;
If necessary, it is possible to configure the simulation of lost packets during transmission.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_emulation.png]]&lt;br /&gt;
 &lt;br /&gt;
In the CubeNet, the transparency and the size of the cube unfolding are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_CubeNet.png]]&lt;br /&gt;
&lt;br /&gt;
In the Scene, the removal of the camera, the field of view, the backdrop are configured.&lt;br /&gt;
&lt;br /&gt;
ABI calls - displays abi function calls to the console.&lt;br /&gt;
&lt;br /&gt;
Console follows mouse click - if you click on one of the modules of the virtual cube model, it opens the console tab corresponding to the module number.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_scene.png]]&lt;br /&gt;
&lt;br /&gt;
====Settings Tab====&lt;br /&gt;
&lt;br /&gt;
This is where the PAWN compiler path and python path are selected. &lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_settings_tab.png]]&lt;br /&gt;
&lt;br /&gt;
===Console and logs===&lt;br /&gt;
&lt;br /&gt;
Contains tabs for displaying script assembly logs and tabs with the console of each module separately.&lt;br /&gt;
&lt;br /&gt;
===Controls===&lt;br /&gt;
&lt;br /&gt;
LMB on a cube - rotation of the sides.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) on a cube - tilt the cube.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) past the cube - rotate the camera.&lt;br /&gt;
&lt;br /&gt;
Mouse wheel - zoom out / zoom in the camera.&lt;br /&gt;
&lt;br /&gt;
==Quick start==&lt;br /&gt;
&lt;br /&gt;
Go to https://github.com/wowcube/WOWCube_apps_examples&lt;br /&gt;
&lt;br /&gt;
Clone or download to the necessary folder.&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator.&lt;br /&gt;
&lt;br /&gt;
In ''Project'' tab switch Pawn mode.&lt;br /&gt;
&lt;br /&gt;
Specify ''Project path'' to the folder with examples.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_path_to_examples.png]]&lt;br /&gt;
&lt;br /&gt;
Under ''Run configuration'' choose example project.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_choose_example.png]]&lt;br /&gt;
&lt;br /&gt;
You can press 'i' button to watch what resources loaded for each script&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_resources_for_scripts.png]]&lt;br /&gt;
&lt;br /&gt;
Press ''Start button'' to launch emulation&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_launched_first_example.png]]&lt;br /&gt;
&lt;br /&gt;
In order to make changes in examples you need:&lt;br /&gt;
&lt;br /&gt;
* Go to folder where your WOWCube examples located&lt;br /&gt;
* Open file 'example1.pwn' with any text redactor&lt;br /&gt;
* make what changes you need&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=176</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=176"/>
		<updated>2021-06-22T11:50:27Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* WOWCube Emulator interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete.&lt;br /&gt;
[[File:Highlight_Latest_Python_3_Release_link.png]]&lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
[[File:Python_installation_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
[[File:Python_disable_path_length_limit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing libraries'''&lt;br /&gt;
&lt;br /&gt;
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.&lt;br /&gt;
&lt;br /&gt;
[[File:Start_menu_with_PowerShell.png]]&lt;br /&gt;
&lt;br /&gt;
Type command &amp;quot;pip install intelhex pillow&amp;quot; and press enter. &lt;br /&gt;
[[File:Intelhex_and_pillow_installation.png]]&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
''pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow''&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file, drag the WOWCube Emulator application into the Applications folder. &lt;br /&gt;
[[File:Installation_on_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application.&lt;br /&gt;
[[File:Error_message_macOS_emulator_installation.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Terminal_window_in_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
In the terminal, write the command ''/ Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube'' and press enter.&lt;br /&gt;
&lt;br /&gt;
If the following error occurs&lt;br /&gt;
&lt;br /&gt;
''/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube''&lt;br /&gt;
&lt;br /&gt;
Then run the following command ''xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/''. It will output errors Permission Denied, but they are expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
For macOS version below Catalina open a terminal, install and download Homebrew&lt;br /&gt;
&lt;br /&gt;
''/ bin / bash -c &amp;quot;$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Homebrew is a package manager that lets you install Open Source applications.&lt;br /&gt;
&lt;br /&gt;
Next, install Python 3 and Pip&lt;br /&gt;
&lt;br /&gt;
''brew install python3''&lt;br /&gt;
&lt;br /&gt;
''brew cask install python3''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.&lt;br /&gt;
&lt;br /&gt;
''python3 -V''&lt;br /&gt;
&lt;br /&gt;
This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute&lt;br /&gt;
&lt;br /&gt;
''python -V''&lt;br /&gt;
&lt;br /&gt;
If it displays “Python 2.x.x”, then Python 3 is not installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install pip:&lt;br /&gt;
&lt;br /&gt;
''curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3''&lt;br /&gt;
&lt;br /&gt;
[[File:Check_for_python_and_installing_pip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing labraries'''&lt;br /&gt;
&lt;br /&gt;
Install IntelHex and Pillow libraries.&lt;br /&gt;
&lt;br /&gt;
''pip3 install pillow intelhex''&lt;br /&gt;
&lt;br /&gt;
==Starting WOWCube Emulator==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator by clicking on shortcut on desktop.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_shortcut_windows.png]]&lt;br /&gt;
&lt;br /&gt;
On first launch, a warning from the firewall will appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_security_alert_first_emulator_launch.png]]&lt;br /&gt;
&lt;br /&gt;
Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open terminal and enter ''WOWCube Emulator'' then and press Enter.&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator interface==&lt;br /&gt;
&lt;br /&gt;
===General view===&lt;br /&gt;
&lt;br /&gt;
There are 4 main groups of widgets in the WOWCube Emulator interface.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_UI.png]]&lt;br /&gt;
&lt;br /&gt;
===Cube model interactions===&lt;br /&gt;
&lt;br /&gt;
Contains links for interacting with the cube module. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* simulates the shaking of a cube&lt;br /&gt;
* returns the cube module to its original state (restoring rotations and position)&lt;br /&gt;
* open code redactor (does not work in version 2.2.0 and below)&lt;br /&gt;
* rotates a random side of the cube&lt;br /&gt;
&lt;br /&gt;
===Emulation progress control===&lt;br /&gt;
&lt;br /&gt;
Serves to interact with the progress of the script. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* start emulation of the selected pawn script. Аfter startup is replaced by the emulation restart button&lt;br /&gt;
* stops pawn script emulation&lt;br /&gt;
* loading a script to a physical cube using the bluetooth protocol (does not work in version 2.2.0 and below)&lt;br /&gt;
&lt;br /&gt;
===General settings===&lt;br /&gt;
&lt;br /&gt;
'''''Project tab'''''&lt;br /&gt;
&lt;br /&gt;
In this tab you can choose one of two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* Pawn;&lt;br /&gt;
* Projector.&lt;br /&gt;
 &lt;br /&gt;
''Projector mode''&lt;br /&gt;
&lt;br /&gt;
The projector is used to transfer images from a computer or mobile device to the WOWCube via the Bluetooth protocol.&lt;br /&gt;
&lt;br /&gt;
The projector in the WOWCube Emulator is used for prototyping and faster development of web-projector applications.&lt;br /&gt;
&lt;br /&gt;
''Pawn Mode''&lt;br /&gt;
&lt;br /&gt;
In this mode, you can:&lt;br /&gt;
&lt;br /&gt;
* select the path to the projects folder&lt;br /&gt;
* select a startup project&lt;br /&gt;
* view additional data for a running project&lt;br /&gt;
&lt;br /&gt;
'''''View tab'''''&lt;br /&gt;
&lt;br /&gt;
The Sound adjusts the overall volume.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_sound.png]]&lt;br /&gt;
&lt;br /&gt;
In the Emulation, the transparency of the overlay is adjusted. The overlay displays on each module its current number, screen and adjacent modules.&lt;br /&gt;
&lt;br /&gt;
The Limit FPS slider allows you to limit the frame rate in the application running on the emulator.&lt;br /&gt;
&lt;br /&gt;
If necessary, it is possible to configure the simulation of lost packets during transmission.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_emulation.png]]&lt;br /&gt;
 &lt;br /&gt;
In the CubeNet, the transparency and the size of the cube unfolding are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_CubeNet.png]]&lt;br /&gt;
&lt;br /&gt;
In the Scene, the removal of the camera, the field of view, the backdrop are configured.&lt;br /&gt;
&lt;br /&gt;
ABI calls - displays abi function calls to the console.&lt;br /&gt;
&lt;br /&gt;
Console follows mouse click - if you click on one of the modules of the virtual cube model, it opens the console tab corresponding to the module number.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_scene.png]]&lt;br /&gt;
&lt;br /&gt;
'''''Settings Tab'''''&lt;br /&gt;
&lt;br /&gt;
This is where the PAWN compiler path and python path are selected. &lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_settings_tab.png]]&lt;br /&gt;
&lt;br /&gt;
===Console and logs===&lt;br /&gt;
&lt;br /&gt;
Contains tabs for displaying script assembly logs and tabs with the console of each module separately.&lt;br /&gt;
&lt;br /&gt;
===Controls===&lt;br /&gt;
&lt;br /&gt;
LMB on a cube - rotation of the sides.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) on a cube - tilt the cube.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) past the cube - rotate the camera.&lt;br /&gt;
&lt;br /&gt;
Mouse wheel - zoom out / zoom in the camera.&lt;br /&gt;
&lt;br /&gt;
==Quick start==&lt;br /&gt;
&lt;br /&gt;
Go to https://github.com/wowcube/WOWCube_apps_examples&lt;br /&gt;
&lt;br /&gt;
Clone or download to the necessary folder.&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator.&lt;br /&gt;
&lt;br /&gt;
In ''Project'' tab switch Pawn mode.&lt;br /&gt;
&lt;br /&gt;
Specify ''Project path'' to the folder with examples.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_path_to_examples.png]]&lt;br /&gt;
&lt;br /&gt;
Under ''Run configuration'' choose example project.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_choose_example.png]]&lt;br /&gt;
&lt;br /&gt;
You can press 'i' button to watch what resources loaded for each script&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_resources_for_scripts.png]]&lt;br /&gt;
&lt;br /&gt;
Press ''Start button'' to launch emulation&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_launched_first_example.png]]&lt;br /&gt;
&lt;br /&gt;
In order to make changes in examples you need:&lt;br /&gt;
&lt;br /&gt;
* Go to folder where your WOWCube examples located&lt;br /&gt;
* Open file 'example1.pwn' with any text redactor&lt;br /&gt;
* make what changes you need&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=175</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=175"/>
		<updated>2021-06-22T10:59:03Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* WOWCube Emulator interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete.&lt;br /&gt;
[[File:Highlight_Latest_Python_3_Release_link.png]]&lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
[[File:Python_installation_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
[[File:Python_disable_path_length_limit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing libraries'''&lt;br /&gt;
&lt;br /&gt;
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.&lt;br /&gt;
&lt;br /&gt;
[[File:Start_menu_with_PowerShell.png]]&lt;br /&gt;
&lt;br /&gt;
Type command &amp;quot;pip install intelhex pillow&amp;quot; and press enter. &lt;br /&gt;
[[File:Intelhex_and_pillow_installation.png]]&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
''pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow''&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file, drag the WOWCube Emulator application into the Applications folder. &lt;br /&gt;
[[File:Installation_on_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application.&lt;br /&gt;
[[File:Error_message_macOS_emulator_installation.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Terminal_window_in_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
In the terminal, write the command ''/ Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube'' and press enter.&lt;br /&gt;
&lt;br /&gt;
If the following error occurs&lt;br /&gt;
&lt;br /&gt;
''/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube''&lt;br /&gt;
&lt;br /&gt;
Then run the following command ''xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/''. It will output errors Permission Denied, but they are expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
For macOS version below Catalina open a terminal, install and download Homebrew&lt;br /&gt;
&lt;br /&gt;
''/ bin / bash -c &amp;quot;$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Homebrew is a package manager that lets you install Open Source applications.&lt;br /&gt;
&lt;br /&gt;
Next, install Python 3 and Pip&lt;br /&gt;
&lt;br /&gt;
''brew install python3''&lt;br /&gt;
&lt;br /&gt;
''brew cask install python3''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.&lt;br /&gt;
&lt;br /&gt;
''python3 -V''&lt;br /&gt;
&lt;br /&gt;
This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute&lt;br /&gt;
&lt;br /&gt;
''python -V''&lt;br /&gt;
&lt;br /&gt;
If it displays “Python 2.x.x”, then Python 3 is not installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install pip:&lt;br /&gt;
&lt;br /&gt;
''curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3''&lt;br /&gt;
&lt;br /&gt;
[[File:Check_for_python_and_installing_pip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing labraries'''&lt;br /&gt;
&lt;br /&gt;
Install IntelHex and Pillow libraries.&lt;br /&gt;
&lt;br /&gt;
''pip3 install pillow intelhex''&lt;br /&gt;
&lt;br /&gt;
==Starting WOWCube Emulator==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator by clicking on shortcut on desktop.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_shortcut_windows.png]]&lt;br /&gt;
&lt;br /&gt;
On first launch, a warning from the firewall will appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_security_alert_first_emulator_launch.png]]&lt;br /&gt;
&lt;br /&gt;
Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open terminal and enter ''WOWCube Emulator'' then and press Enter.&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator interface==&lt;br /&gt;
&lt;br /&gt;
There are 4 main groups of widgets in the WOWCube Emulator interface.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_UI.png]]&lt;br /&gt;
&lt;br /&gt;
'''First group'''&lt;br /&gt;
&lt;br /&gt;
Contains links for interacting with the cube module. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* simulates the shaking of a cube&lt;br /&gt;
* returns the cube module to its original state (restoring rotations and position)&lt;br /&gt;
* rotates a random side of the cube&lt;br /&gt;
&lt;br /&gt;
'''Second group'''&lt;br /&gt;
&lt;br /&gt;
Serves to interact with the progress of the script. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* start emulation of the selected pawn script. Аfter startup is replaced by the emulation restart button&lt;br /&gt;
* stops pawn script emulation&lt;br /&gt;
* loading a script to a physical cube using the bluetooth protocol (does not work in version 2.2.0 and below)&lt;br /&gt;
&lt;br /&gt;
'''Third group'''&lt;br /&gt;
&lt;br /&gt;
'''''Project tab'''''&lt;br /&gt;
&lt;br /&gt;
In this tab you can choose one of two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* Pawn;&lt;br /&gt;
* Projector.&lt;br /&gt;
 &lt;br /&gt;
''Projector mode''&lt;br /&gt;
&lt;br /&gt;
The projector is used to transfer images from a computer or mobile device to the WOWCube via the Bluetooth protocol.&lt;br /&gt;
&lt;br /&gt;
The projector in the WOWCube Emulator is used for prototyping and faster development of web-projector applications.&lt;br /&gt;
&lt;br /&gt;
''Pawn Mode''&lt;br /&gt;
&lt;br /&gt;
In this mode, you can:&lt;br /&gt;
&lt;br /&gt;
* select the path to the projects folder&lt;br /&gt;
* select a startup project&lt;br /&gt;
* view additional data for a running project&lt;br /&gt;
&lt;br /&gt;
'''''View tab'''''&lt;br /&gt;
&lt;br /&gt;
The Sound adjusts the overall volume.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_sound.png]]&lt;br /&gt;
&lt;br /&gt;
In the Emulation, the transparency of the overlay is adjusted. The overlay displays on each module its current number, screen and adjacent modules.&lt;br /&gt;
&lt;br /&gt;
The Limit FPS slider allows you to limit the frame rate in the application running on the emulator.&lt;br /&gt;
&lt;br /&gt;
If necessary, it is possible to configure the simulation of lost packets during transmission.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_emulation.png]]&lt;br /&gt;
 &lt;br /&gt;
In the CubeNet, the transparency and the size of the cube unfolding are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_CubeNet.png]]&lt;br /&gt;
&lt;br /&gt;
In the Scene, the removal of the camera, the field of view, the backdrop are configured.&lt;br /&gt;
&lt;br /&gt;
ABI calls - displays abi function calls to the console.&lt;br /&gt;
&lt;br /&gt;
Console follows mouse click - if you click on one of the modules of the virtual cube model, it opens the console tab corresponding to the module number.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_scene.png]]&lt;br /&gt;
&lt;br /&gt;
'''''Settings Tab'''''&lt;br /&gt;
&lt;br /&gt;
This is where the PAWN compiler path and python path are selected. &lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_settings_tab.png]]&lt;br /&gt;
&lt;br /&gt;
'''Fourth group'''&lt;br /&gt;
&lt;br /&gt;
Contains tabs for displaying script assembly logs and tabs with the console of each module separately.&lt;br /&gt;
&lt;br /&gt;
===Controls===&lt;br /&gt;
&lt;br /&gt;
LMB on a cube - rotation of the sides.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) on a cube - tilt the cube.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) past the cube - rotate the camera.&lt;br /&gt;
&lt;br /&gt;
Mouse wheel - zoom out / zoom in the camera.&lt;br /&gt;
&lt;br /&gt;
==Quick start==&lt;br /&gt;
&lt;br /&gt;
Go to https://github.com/wowcube/WOWCube_apps_examples&lt;br /&gt;
&lt;br /&gt;
Clone or download to the necessary folder.&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator.&lt;br /&gt;
&lt;br /&gt;
In ''Project'' tab switch Pawn mode.&lt;br /&gt;
&lt;br /&gt;
Specify ''Project path'' to the folder with examples.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_path_to_examples.png]]&lt;br /&gt;
&lt;br /&gt;
Under ''Run configuration'' choose example project.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_choose_example.png]]&lt;br /&gt;
&lt;br /&gt;
You can press 'i' button to watch what resources loaded for each script&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_resources_for_scripts.png]]&lt;br /&gt;
&lt;br /&gt;
Press ''Start button'' to launch emulation&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_launched_first_example.png]]&lt;br /&gt;
&lt;br /&gt;
In order to make changes in examples you need:&lt;br /&gt;
&lt;br /&gt;
* Go to folder where your WOWCube examples located&lt;br /&gt;
* Open file 'example1.pwn' with any text redactor&lt;br /&gt;
* make what changes you need&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=174</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=174"/>
		<updated>2021-06-22T10:47:51Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* Quick start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete.&lt;br /&gt;
[[File:Highlight_Latest_Python_3_Release_link.png]]&lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
[[File:Python_installation_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
[[File:Python_disable_path_length_limit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing libraries'''&lt;br /&gt;
&lt;br /&gt;
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.&lt;br /&gt;
&lt;br /&gt;
[[File:Start_menu_with_PowerShell.png]]&lt;br /&gt;
&lt;br /&gt;
Type command &amp;quot;pip install intelhex pillow&amp;quot; and press enter. &lt;br /&gt;
[[File:Intelhex_and_pillow_installation.png]]&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
''pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow''&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file, drag the WOWCube Emulator application into the Applications folder. &lt;br /&gt;
[[File:Installation_on_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application.&lt;br /&gt;
[[File:Error_message_macOS_emulator_installation.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Terminal_window_in_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
In the terminal, write the command ''/ Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube'' and press enter.&lt;br /&gt;
&lt;br /&gt;
If the following error occurs&lt;br /&gt;
&lt;br /&gt;
''/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube''&lt;br /&gt;
&lt;br /&gt;
Then run the following command ''xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/''. It will output errors Permission Denied, but they are expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
For macOS version below Catalina open a terminal, install and download Homebrew&lt;br /&gt;
&lt;br /&gt;
''/ bin / bash -c &amp;quot;$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Homebrew is a package manager that lets you install Open Source applications.&lt;br /&gt;
&lt;br /&gt;
Next, install Python 3 and Pip&lt;br /&gt;
&lt;br /&gt;
''brew install python3''&lt;br /&gt;
&lt;br /&gt;
''brew cask install python3''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.&lt;br /&gt;
&lt;br /&gt;
''python3 -V''&lt;br /&gt;
&lt;br /&gt;
This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute&lt;br /&gt;
&lt;br /&gt;
''python -V''&lt;br /&gt;
&lt;br /&gt;
If it displays “Python 2.x.x”, then Python 3 is not installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install pip:&lt;br /&gt;
&lt;br /&gt;
''curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3''&lt;br /&gt;
&lt;br /&gt;
[[File:Check_for_python_and_installing_pip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing labraries'''&lt;br /&gt;
&lt;br /&gt;
Install IntelHex and Pillow libraries.&lt;br /&gt;
&lt;br /&gt;
''pip3 install pillow intelhex''&lt;br /&gt;
&lt;br /&gt;
==Starting WOWCube Emulator==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator by clicking on shortcut on desktop.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_shortcut_windows.png]]&lt;br /&gt;
&lt;br /&gt;
On first launch, a warning from the firewall will appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_security_alert_first_emulator_launch.png]]&lt;br /&gt;
&lt;br /&gt;
Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open terminal and enter ''WOWCube Emulator'' then and press Enter.&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator interface==&lt;br /&gt;
&lt;br /&gt;
There are 4 main groups of widgets in the WOWCube Emulator interface.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_UI.png]]&lt;br /&gt;
&lt;br /&gt;
'''First group'''&lt;br /&gt;
&lt;br /&gt;
Contains links for interacting with the cube module. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* simulates the shaking of a cube&lt;br /&gt;
* returns the cube module to its original state (restoring rotations and position)&lt;br /&gt;
* rotates a random side of the cube&lt;br /&gt;
&lt;br /&gt;
'''Second group'''&lt;br /&gt;
&lt;br /&gt;
Serves to interact with the progress of the script. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* start emulation of the selected pawn script. Аfter startup is replaced by the emulation restart button&lt;br /&gt;
* stops pawn script emulation&lt;br /&gt;
* loading a script to a physical cube using the bluetooth protocol (does not work in version 2.2.0 and below)&lt;br /&gt;
&lt;br /&gt;
'''Third group'''&lt;br /&gt;
&lt;br /&gt;
'''''Project tab'''''&lt;br /&gt;
&lt;br /&gt;
In this tab you can choose one of two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* Pawn;&lt;br /&gt;
* Projector.&lt;br /&gt;
 &lt;br /&gt;
''Projector mode''&lt;br /&gt;
&lt;br /&gt;
The projector is used to transfer images from a computer or mobile device to the WOWCube via the Bluetooth protocol.&lt;br /&gt;
&lt;br /&gt;
The projector in the WOWCube Emulator is used for prototyping and faster development of web-projector applications.&lt;br /&gt;
&lt;br /&gt;
''Pawn Mode''&lt;br /&gt;
&lt;br /&gt;
In this mode, you can:&lt;br /&gt;
&lt;br /&gt;
* select the path to the projects folder&lt;br /&gt;
* select a startup project&lt;br /&gt;
* view additional data for a running project&lt;br /&gt;
&lt;br /&gt;
'''''View tab'''''&lt;br /&gt;
&lt;br /&gt;
The Sound adjusts the overall volume.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_sound.png]]&lt;br /&gt;
&lt;br /&gt;
In the Emulation, the transparency of the overlay is adjusted. The overlay displays on each module its current number, screen and adjacent modules.&lt;br /&gt;
&lt;br /&gt;
The Limit FPS slider allows you to limit the frame rate in the application running on the emulator.&lt;br /&gt;
&lt;br /&gt;
If necessary, it is possible to configure the simulation of lost packets during transmission.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_emulation.png]]&lt;br /&gt;
 &lt;br /&gt;
In the CubeNet, the transparency and the size of the cube unfolding are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_CubeNet.png]]&lt;br /&gt;
&lt;br /&gt;
In the Scene, the removal of the camera, the field of view, the backdrop are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_scene.png]]&lt;br /&gt;
&lt;br /&gt;
'''''Settings Tab'''''&lt;br /&gt;
&lt;br /&gt;
This is where the PAWN compiler path and python path are selected. &lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_settings_tab.png]]&lt;br /&gt;
&lt;br /&gt;
'''Fourth group'''&lt;br /&gt;
&lt;br /&gt;
Contains tabs for displaying script assembly logs and tabs with the console of each module separately.&lt;br /&gt;
&lt;br /&gt;
===Controls===&lt;br /&gt;
&lt;br /&gt;
LMB on a cube - rotation of the sides.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) on a cube - tilt the cube.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) past the cube - rotate the camera.&lt;br /&gt;
&lt;br /&gt;
Mouse wheel - zoom out / zoom in the camera.&lt;br /&gt;
&lt;br /&gt;
==Quick start==&lt;br /&gt;
&lt;br /&gt;
Go to https://github.com/wowcube/WOWCube_apps_examples&lt;br /&gt;
&lt;br /&gt;
Clone or download to the necessary folder.&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator.&lt;br /&gt;
&lt;br /&gt;
In ''Project'' tab switch Pawn mode.&lt;br /&gt;
&lt;br /&gt;
Specify ''Project path'' to the folder with examples.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_path_to_examples.png]]&lt;br /&gt;
&lt;br /&gt;
Under ''Run configuration'' choose example project.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_choose_example.png]]&lt;br /&gt;
&lt;br /&gt;
You can press 'i' button to watch what resources loaded for each script&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_resources_for_scripts.png]]&lt;br /&gt;
&lt;br /&gt;
Press ''Start button'' to launch emulation&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_launched_first_example.png]]&lt;br /&gt;
&lt;br /&gt;
In order to make changes in examples you need:&lt;br /&gt;
&lt;br /&gt;
* Go to folder where your WOWCube examples located&lt;br /&gt;
* Open file 'example1.pwn' with any text redactor&lt;br /&gt;
* make what changes you need&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=173</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=173"/>
		<updated>2021-06-22T09:13:29Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* Quick start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete.&lt;br /&gt;
[[File:Highlight_Latest_Python_3_Release_link.png]]&lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
[[File:Python_installation_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
[[File:Python_disable_path_length_limit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing libraries'''&lt;br /&gt;
&lt;br /&gt;
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.&lt;br /&gt;
&lt;br /&gt;
[[File:Start_menu_with_PowerShell.png]]&lt;br /&gt;
&lt;br /&gt;
Type command &amp;quot;pip install intelhex pillow&amp;quot; and press enter. &lt;br /&gt;
[[File:Intelhex_and_pillow_installation.png]]&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
''pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow''&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file, drag the WOWCube Emulator application into the Applications folder. &lt;br /&gt;
[[File:Installation_on_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application.&lt;br /&gt;
[[File:Error_message_macOS_emulator_installation.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Terminal_window_in_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
In the terminal, write the command ''/ Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube'' and press enter.&lt;br /&gt;
&lt;br /&gt;
If the following error occurs&lt;br /&gt;
&lt;br /&gt;
''/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube''&lt;br /&gt;
&lt;br /&gt;
Then run the following command ''xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/''. It will output errors Permission Denied, but they are expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
For macOS version below Catalina open a terminal, install and download Homebrew&lt;br /&gt;
&lt;br /&gt;
''/ bin / bash -c &amp;quot;$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Homebrew is a package manager that lets you install Open Source applications.&lt;br /&gt;
&lt;br /&gt;
Next, install Python 3 and Pip&lt;br /&gt;
&lt;br /&gt;
''brew install python3''&lt;br /&gt;
&lt;br /&gt;
''brew cask install python3''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.&lt;br /&gt;
&lt;br /&gt;
''python3 -V''&lt;br /&gt;
&lt;br /&gt;
This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute&lt;br /&gt;
&lt;br /&gt;
''python -V''&lt;br /&gt;
&lt;br /&gt;
If it displays “Python 2.x.x”, then Python 3 is not installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install pip:&lt;br /&gt;
&lt;br /&gt;
''curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3''&lt;br /&gt;
&lt;br /&gt;
[[File:Check_for_python_and_installing_pip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing labraries'''&lt;br /&gt;
&lt;br /&gt;
Install IntelHex and Pillow libraries.&lt;br /&gt;
&lt;br /&gt;
''pip3 install pillow intelhex''&lt;br /&gt;
&lt;br /&gt;
==Starting WOWCube Emulator==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator by clicking on shortcut on desktop.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_shortcut_windows.png]]&lt;br /&gt;
&lt;br /&gt;
On first launch, a warning from the firewall will appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_security_alert_first_emulator_launch.png]]&lt;br /&gt;
&lt;br /&gt;
Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open terminal and enter ''WOWCube Emulator'' then and press Enter.&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator interface==&lt;br /&gt;
&lt;br /&gt;
There are 4 main groups of widgets in the WOWCube Emulator interface.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_UI.png]]&lt;br /&gt;
&lt;br /&gt;
'''First group'''&lt;br /&gt;
&lt;br /&gt;
Contains links for interacting with the cube module. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* simulates the shaking of a cube&lt;br /&gt;
* returns the cube module to its original state (restoring rotations and position)&lt;br /&gt;
* rotates a random side of the cube&lt;br /&gt;
&lt;br /&gt;
'''Second group'''&lt;br /&gt;
&lt;br /&gt;
Serves to interact with the progress of the script. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* start emulation of the selected pawn script. Аfter startup is replaced by the emulation restart button&lt;br /&gt;
* stops pawn script emulation&lt;br /&gt;
* loading a script to a physical cube using the bluetooth protocol (does not work in version 2.2.0 and below)&lt;br /&gt;
&lt;br /&gt;
'''Third group'''&lt;br /&gt;
&lt;br /&gt;
'''''Project tab'''''&lt;br /&gt;
&lt;br /&gt;
In this tab you can choose one of two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* Pawn;&lt;br /&gt;
* Projector.&lt;br /&gt;
 &lt;br /&gt;
''Projector mode''&lt;br /&gt;
&lt;br /&gt;
The projector is used to transfer images from a computer or mobile device to the WOWCube via the Bluetooth protocol.&lt;br /&gt;
&lt;br /&gt;
The projector in the WOWCube Emulator is used for prototyping and faster development of web-projector applications.&lt;br /&gt;
&lt;br /&gt;
''Pawn Mode''&lt;br /&gt;
&lt;br /&gt;
In this mode, you can:&lt;br /&gt;
&lt;br /&gt;
* select the path to the projects folder&lt;br /&gt;
* select a startup project&lt;br /&gt;
* view additional data for a running project&lt;br /&gt;
&lt;br /&gt;
'''''View tab'''''&lt;br /&gt;
&lt;br /&gt;
The Sound adjusts the overall volume.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_sound.png]]&lt;br /&gt;
&lt;br /&gt;
In the Emulation, the transparency of the overlay is adjusted. The overlay displays on each module its current number, screen and adjacent modules.&lt;br /&gt;
&lt;br /&gt;
The Limit FPS slider allows you to limit the frame rate in the application running on the emulator.&lt;br /&gt;
&lt;br /&gt;
If necessary, it is possible to configure the simulation of lost packets during transmission.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_emulation.png]]&lt;br /&gt;
 &lt;br /&gt;
In the CubeNet, the transparency and the size of the cube unfolding are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_CubeNet.png]]&lt;br /&gt;
&lt;br /&gt;
In the Scene, the removal of the camera, the field of view, the backdrop are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_scene.png]]&lt;br /&gt;
&lt;br /&gt;
'''''Settings Tab'''''&lt;br /&gt;
&lt;br /&gt;
This is where the PAWN compiler path and python path are selected. &lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_settings_tab.png]]&lt;br /&gt;
&lt;br /&gt;
'''Fourth group'''&lt;br /&gt;
&lt;br /&gt;
Contains tabs for displaying script assembly logs and tabs with the console of each module separately.&lt;br /&gt;
&lt;br /&gt;
===Controls===&lt;br /&gt;
&lt;br /&gt;
LMB on a cube - rotation of the sides.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) on a cube - tilt the cube.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) past the cube - rotate the camera.&lt;br /&gt;
&lt;br /&gt;
Mouse wheel - zoom out / zoom in the camera.&lt;br /&gt;
&lt;br /&gt;
==Quick start==&lt;br /&gt;
&lt;br /&gt;
Go to https://github.com/wowcube/WOWCube_apps_examples&lt;br /&gt;
&lt;br /&gt;
Clone or download to the necessary folder.&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator.&lt;br /&gt;
&lt;br /&gt;
In ''Project'' tab switch Pawn mode.&lt;br /&gt;
&lt;br /&gt;
Specify ''Project path'' to the folder with examples.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_path_to_examples.png]]&lt;br /&gt;
&lt;br /&gt;
Under ''Run configuration'' choose example project.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_choose_example.png]]&lt;br /&gt;
&lt;br /&gt;
You can press 'i' button to watch what resources loaded for each script&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_resources_for_scripts.png]]&lt;br /&gt;
&lt;br /&gt;
Press ''Start button'' to launch emulation&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_launched_first_example.png]]&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_emulator_launched_first_example.png&amp;diff=172</id>
		<title>File:WOWCube emulator launched first example.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_emulator_launched_first_example.png&amp;diff=172"/>
		<updated>2021-06-22T09:08:30Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. First example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. First example.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_emulator_resources_for_scripts.png&amp;diff=171</id>
		<title>File:WOWCube emulator resources for scripts.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_emulator_resources_for_scripts.png&amp;diff=171"/>
		<updated>2021-06-22T09:03:25Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Script resources info window.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Script resources info window.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=170</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=170"/>
		<updated>2021-06-22T09:02:01Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* Quick start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete.&lt;br /&gt;
[[File:Highlight_Latest_Python_3_Release_link.png]]&lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
[[File:Python_installation_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
[[File:Python_disable_path_length_limit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing libraries'''&lt;br /&gt;
&lt;br /&gt;
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.&lt;br /&gt;
&lt;br /&gt;
[[File:Start_menu_with_PowerShell.png]]&lt;br /&gt;
&lt;br /&gt;
Type command &amp;quot;pip install intelhex pillow&amp;quot; and press enter. &lt;br /&gt;
[[File:Intelhex_and_pillow_installation.png]]&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
''pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow''&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file, drag the WOWCube Emulator application into the Applications folder. &lt;br /&gt;
[[File:Installation_on_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application.&lt;br /&gt;
[[File:Error_message_macOS_emulator_installation.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Terminal_window_in_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
In the terminal, write the command ''/ Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube'' and press enter.&lt;br /&gt;
&lt;br /&gt;
If the following error occurs&lt;br /&gt;
&lt;br /&gt;
''/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube''&lt;br /&gt;
&lt;br /&gt;
Then run the following command ''xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/''. It will output errors Permission Denied, but they are expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
For macOS version below Catalina open a terminal, install and download Homebrew&lt;br /&gt;
&lt;br /&gt;
''/ bin / bash -c &amp;quot;$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Homebrew is a package manager that lets you install Open Source applications.&lt;br /&gt;
&lt;br /&gt;
Next, install Python 3 and Pip&lt;br /&gt;
&lt;br /&gt;
''brew install python3''&lt;br /&gt;
&lt;br /&gt;
''brew cask install python3''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.&lt;br /&gt;
&lt;br /&gt;
''python3 -V''&lt;br /&gt;
&lt;br /&gt;
This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute&lt;br /&gt;
&lt;br /&gt;
''python -V''&lt;br /&gt;
&lt;br /&gt;
If it displays “Python 2.x.x”, then Python 3 is not installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install pip:&lt;br /&gt;
&lt;br /&gt;
''curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3''&lt;br /&gt;
&lt;br /&gt;
[[File:Check_for_python_and_installing_pip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing labraries'''&lt;br /&gt;
&lt;br /&gt;
Install IntelHex and Pillow libraries.&lt;br /&gt;
&lt;br /&gt;
''pip3 install pillow intelhex''&lt;br /&gt;
&lt;br /&gt;
==Starting WOWCube Emulator==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator by clicking on shortcut on desktop.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_shortcut_windows.png]]&lt;br /&gt;
&lt;br /&gt;
On first launch, a warning from the firewall will appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_security_alert_first_emulator_launch.png]]&lt;br /&gt;
&lt;br /&gt;
Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open terminal and enter ''WOWCube Emulator'' then and press Enter.&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator interface==&lt;br /&gt;
&lt;br /&gt;
There are 4 main groups of widgets in the WOWCube Emulator interface.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_UI.png]]&lt;br /&gt;
&lt;br /&gt;
'''First group'''&lt;br /&gt;
&lt;br /&gt;
Contains links for interacting with the cube module. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* simulates the shaking of a cube&lt;br /&gt;
* returns the cube module to its original state (restoring rotations and position)&lt;br /&gt;
* rotates a random side of the cube&lt;br /&gt;
&lt;br /&gt;
'''Second group'''&lt;br /&gt;
&lt;br /&gt;
Serves to interact with the progress of the script. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* start emulation of the selected pawn script. Аfter startup is replaced by the emulation restart button&lt;br /&gt;
* stops pawn script emulation&lt;br /&gt;
* loading a script to a physical cube using the bluetooth protocol (does not work in version 2.2.0 and below)&lt;br /&gt;
&lt;br /&gt;
'''Third group'''&lt;br /&gt;
&lt;br /&gt;
'''''Project tab'''''&lt;br /&gt;
&lt;br /&gt;
In this tab you can choose one of two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* Pawn;&lt;br /&gt;
* Projector.&lt;br /&gt;
 &lt;br /&gt;
''Projector mode''&lt;br /&gt;
&lt;br /&gt;
The projector is used to transfer images from a computer or mobile device to the WOWCube via the Bluetooth protocol.&lt;br /&gt;
&lt;br /&gt;
The projector in the WOWCube Emulator is used for prototyping and faster development of web-projector applications.&lt;br /&gt;
&lt;br /&gt;
''Pawn Mode''&lt;br /&gt;
&lt;br /&gt;
In this mode, you can:&lt;br /&gt;
&lt;br /&gt;
* select the path to the projects folder&lt;br /&gt;
* select a startup project&lt;br /&gt;
* view additional data for a running project&lt;br /&gt;
&lt;br /&gt;
'''''View tab'''''&lt;br /&gt;
&lt;br /&gt;
The Sound adjusts the overall volume.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_sound.png]]&lt;br /&gt;
&lt;br /&gt;
In the Emulation, the transparency of the overlay is adjusted. The overlay displays on each module its current number, screen and adjacent modules.&lt;br /&gt;
&lt;br /&gt;
The Limit FPS slider allows you to limit the frame rate in the application running on the emulator.&lt;br /&gt;
&lt;br /&gt;
If necessary, it is possible to configure the simulation of lost packets during transmission.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_emulation.png]]&lt;br /&gt;
 &lt;br /&gt;
In the CubeNet, the transparency and the size of the cube unfolding are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_CubeNet.png]]&lt;br /&gt;
&lt;br /&gt;
In the Scene, the removal of the camera, the field of view, the backdrop are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_scene.png]]&lt;br /&gt;
&lt;br /&gt;
'''''Settings Tab'''''&lt;br /&gt;
&lt;br /&gt;
This is where the PAWN compiler path and python path are selected. &lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_settings_tab.png]]&lt;br /&gt;
&lt;br /&gt;
'''Fourth group'''&lt;br /&gt;
&lt;br /&gt;
Contains tabs for displaying script assembly logs and tabs with the console of each module separately.&lt;br /&gt;
&lt;br /&gt;
===Controls===&lt;br /&gt;
&lt;br /&gt;
LMB on a cube - rotation of the sides.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) on a cube - tilt the cube.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) past the cube - rotate the camera.&lt;br /&gt;
&lt;br /&gt;
Mouse wheel - zoom out / zoom in the camera.&lt;br /&gt;
&lt;br /&gt;
==Quick start==&lt;br /&gt;
&lt;br /&gt;
Go to https://github.com/wowcube/WOWCube_apps_examples&lt;br /&gt;
&lt;br /&gt;
Clone or download to the necessary folder.&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator.&lt;br /&gt;
&lt;br /&gt;
In ''Project'' tab switch Pawn mode.&lt;br /&gt;
&lt;br /&gt;
Specify ''Project path'' to the folder with examples.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_path_to_examples.png]]&lt;br /&gt;
&lt;br /&gt;
Under ''Run configuration'' choose example project.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_emulator_choose_example.png]]&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_emulator_choose_example.png&amp;diff=169</id>
		<title>File:WOWCube emulator choose example.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_emulator_choose_example.png&amp;diff=169"/>
		<updated>2021-06-22T08:33:28Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Choose example from drop-down list.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Choose example from drop-down list.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_emulator_path_to_examples.png&amp;diff=168</id>
		<title>File:WOWCube emulator path to examples.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_emulator_path_to_examples.png&amp;diff=168"/>
		<updated>2021-06-22T08:15:58Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Specify project path to examples.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Specify project path to examples.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_view_tab_scene.png&amp;diff=167</id>
		<title>File:WOWCube Emulator view tab scene.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_view_tab_scene.png&amp;diff=167"/>
		<updated>2021-06-22T07:40:35Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: Raccoon pirate uploaded a new version of File:WOWCube Emulator view tab scene.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Scene settings in view tab.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=166</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=166"/>
		<updated>2021-06-22T07:06:46Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* WOWCube Emulator interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete.&lt;br /&gt;
[[File:Highlight_Latest_Python_3_Release_link.png]]&lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
[[File:Python_installation_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
[[File:Python_disable_path_length_limit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing libraries'''&lt;br /&gt;
&lt;br /&gt;
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.&lt;br /&gt;
&lt;br /&gt;
[[File:Start_menu_with_PowerShell.png]]&lt;br /&gt;
&lt;br /&gt;
Type command &amp;quot;pip install intelhex pillow&amp;quot; and press enter. &lt;br /&gt;
[[File:Intelhex_and_pillow_installation.png]]&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
''pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow''&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file, drag the WOWCube Emulator application into the Applications folder. &lt;br /&gt;
[[File:Installation_on_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application.&lt;br /&gt;
[[File:Error_message_macOS_emulator_installation.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Terminal_window_in_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
In the terminal, write the command ''/ Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube'' and press enter.&lt;br /&gt;
&lt;br /&gt;
If the following error occurs&lt;br /&gt;
&lt;br /&gt;
''/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube''&lt;br /&gt;
&lt;br /&gt;
Then run the following command ''xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/''. It will output errors Permission Denied, but they are expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
For macOS version below Catalina open a terminal, install and download Homebrew&lt;br /&gt;
&lt;br /&gt;
''/ bin / bash -c &amp;quot;$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Homebrew is a package manager that lets you install Open Source applications.&lt;br /&gt;
&lt;br /&gt;
Next, install Python 3 and Pip&lt;br /&gt;
&lt;br /&gt;
''brew install python3''&lt;br /&gt;
&lt;br /&gt;
''brew cask install python3''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.&lt;br /&gt;
&lt;br /&gt;
''python3 -V''&lt;br /&gt;
&lt;br /&gt;
This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute&lt;br /&gt;
&lt;br /&gt;
''python -V''&lt;br /&gt;
&lt;br /&gt;
If it displays “Python 2.x.x”, then Python 3 is not installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install pip:&lt;br /&gt;
&lt;br /&gt;
''curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3''&lt;br /&gt;
&lt;br /&gt;
[[File:Check_for_python_and_installing_pip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing labraries'''&lt;br /&gt;
&lt;br /&gt;
Install IntelHex and Pillow libraries.&lt;br /&gt;
&lt;br /&gt;
''pip3 install pillow intelhex''&lt;br /&gt;
&lt;br /&gt;
==Starting WOWCube Emulator==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator by clicking on shortcut on desktop.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_shortcut_windows.png]]&lt;br /&gt;
&lt;br /&gt;
On first launch, a warning from the firewall will appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_security_alert_first_emulator_launch.png]]&lt;br /&gt;
&lt;br /&gt;
Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open terminal and enter ''WOWCube Emulator'' then and press Enter.&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator interface==&lt;br /&gt;
&lt;br /&gt;
There are 4 main groups of widgets in the WOWCube Emulator interface.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_UI.png]]&lt;br /&gt;
&lt;br /&gt;
'''First group'''&lt;br /&gt;
&lt;br /&gt;
Contains links for interacting with the cube module. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* simulates the shaking of a cube&lt;br /&gt;
* returns the cube module to its original state (restoring rotations and position)&lt;br /&gt;
* rotates a random side of the cube&lt;br /&gt;
&lt;br /&gt;
'''Second group'''&lt;br /&gt;
&lt;br /&gt;
Serves to interact with the progress of the script. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* start emulation of the selected pawn script. Аfter startup is replaced by the emulation restart button&lt;br /&gt;
* stops pawn script emulation&lt;br /&gt;
* loading a script to a physical cube using the bluetooth protocol (does not work in version 2.2.0 and below)&lt;br /&gt;
&lt;br /&gt;
'''Third group'''&lt;br /&gt;
&lt;br /&gt;
'''''Project tab'''''&lt;br /&gt;
&lt;br /&gt;
In this tab you can choose one of two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* Pawn;&lt;br /&gt;
* Projector.&lt;br /&gt;
 &lt;br /&gt;
''Projector mode''&lt;br /&gt;
&lt;br /&gt;
The projector is used to transfer images from a computer or mobile device to the WOWCube via the Bluetooth protocol.&lt;br /&gt;
&lt;br /&gt;
The projector in the WOWCube Emulator is used for prototyping and faster development of web-projector applications.&lt;br /&gt;
&lt;br /&gt;
''Pawn Mode''&lt;br /&gt;
&lt;br /&gt;
In this mode, you can:&lt;br /&gt;
&lt;br /&gt;
* select the path to the projects folder&lt;br /&gt;
* select a startup project&lt;br /&gt;
* view additional data for a running project&lt;br /&gt;
&lt;br /&gt;
'''''View tab'''''&lt;br /&gt;
&lt;br /&gt;
The Sound adjusts the overall volume.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_sound.png]]&lt;br /&gt;
&lt;br /&gt;
In the Emulation, the transparency of the overlay is adjusted. The overlay displays on each module its current number, screen and adjacent modules.&lt;br /&gt;
&lt;br /&gt;
The Limit FPS slider allows you to limit the frame rate in the application running on the emulator.&lt;br /&gt;
&lt;br /&gt;
If necessary, it is possible to configure the simulation of lost packets during transmission.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_emulation.png]]&lt;br /&gt;
 &lt;br /&gt;
In the CubeNet, the transparency and the size of the cube unfolding are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_CubeNet.png]]&lt;br /&gt;
&lt;br /&gt;
In the Scene, the removal of the camera, the field of view, the backdrop are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_scene.png]]&lt;br /&gt;
&lt;br /&gt;
'''''Settings Tab'''''&lt;br /&gt;
&lt;br /&gt;
This is where the PAWN compiler path and python path are selected. &lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_settings_tab.png]]&lt;br /&gt;
&lt;br /&gt;
'''Fourth group'''&lt;br /&gt;
&lt;br /&gt;
Contains tabs for displaying script assembly logs and tabs with the console of each module separately.&lt;br /&gt;
&lt;br /&gt;
===Controls===&lt;br /&gt;
&lt;br /&gt;
LMB on a cube - rotation of the sides.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) on a cube - tilt the cube.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) past the cube - rotate the camera.&lt;br /&gt;
&lt;br /&gt;
Mouse wheel - zoom out / zoom in the camera.&lt;br /&gt;
&lt;br /&gt;
==Quick start==&lt;br /&gt;
&lt;br /&gt;
Go to https://github.com/wowcube/WOWCube_apps_examples&lt;br /&gt;
&lt;br /&gt;
Clone to the necessary folder.&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator.&lt;br /&gt;
&lt;br /&gt;
In ''Project'' tab switch Pawn mode.&lt;br /&gt;
&lt;br /&gt;
Specify ''Project path'' to the folder with examples.&lt;br /&gt;
&lt;br /&gt;
Under ''Run configuration'' choose example project.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=165</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=165"/>
		<updated>2021-06-22T06:48:32Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete.&lt;br /&gt;
[[File:Highlight_Latest_Python_3_Release_link.png]]&lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
[[File:Python_installation_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
[[File:Python_disable_path_length_limit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing libraries'''&lt;br /&gt;
&lt;br /&gt;
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.&lt;br /&gt;
&lt;br /&gt;
[[File:Start_menu_with_PowerShell.png]]&lt;br /&gt;
&lt;br /&gt;
Type command &amp;quot;pip install intelhex pillow&amp;quot; and press enter. &lt;br /&gt;
[[File:Intelhex_and_pillow_installation.png]]&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
''pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow''&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file, drag the WOWCube Emulator application into the Applications folder. &lt;br /&gt;
[[File:Installation_on_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application.&lt;br /&gt;
[[File:Error_message_macOS_emulator_installation.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Terminal_window_in_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
In the terminal, write the command ''/ Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube'' and press enter.&lt;br /&gt;
&lt;br /&gt;
If the following error occurs&lt;br /&gt;
&lt;br /&gt;
''/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube''&lt;br /&gt;
&lt;br /&gt;
Then run the following command ''xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/''. It will output errors Permission Denied, but they are expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
For macOS version below Catalina open a terminal, install and download Homebrew&lt;br /&gt;
&lt;br /&gt;
''/ bin / bash -c &amp;quot;$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Homebrew is a package manager that lets you install Open Source applications.&lt;br /&gt;
&lt;br /&gt;
Next, install Python 3 and Pip&lt;br /&gt;
&lt;br /&gt;
''brew install python3''&lt;br /&gt;
&lt;br /&gt;
''brew cask install python3''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.&lt;br /&gt;
&lt;br /&gt;
''python3 -V''&lt;br /&gt;
&lt;br /&gt;
This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute&lt;br /&gt;
&lt;br /&gt;
''python -V''&lt;br /&gt;
&lt;br /&gt;
If it displays “Python 2.x.x”, then Python 3 is not installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install pip:&lt;br /&gt;
&lt;br /&gt;
''curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3''&lt;br /&gt;
&lt;br /&gt;
[[File:Check_for_python_and_installing_pip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing labraries'''&lt;br /&gt;
&lt;br /&gt;
Install IntelHex and Pillow libraries.&lt;br /&gt;
&lt;br /&gt;
''pip3 install pillow intelhex''&lt;br /&gt;
&lt;br /&gt;
==Starting WOWCube Emulator==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator by clicking on shortcut on desktop.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_shortcut_windows.png]]&lt;br /&gt;
&lt;br /&gt;
On first launch, a warning from the firewall will appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_security_alert_first_emulator_launch.png]]&lt;br /&gt;
&lt;br /&gt;
Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open terminal and enter ''WOWCube Emulator'' then and press Enter.&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator interface==&lt;br /&gt;
&lt;br /&gt;
There are 4 main groups of widgets in the WOWCube Emulator interface.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_UI.png]]&lt;br /&gt;
&lt;br /&gt;
'''First group'''&lt;br /&gt;
&lt;br /&gt;
Contains links for interacting with the cube module. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* simulates the shaking of a cube&lt;br /&gt;
* returns the cube module to its original state (restoring rotations and position)&lt;br /&gt;
* rotates a random side of the cube&lt;br /&gt;
&lt;br /&gt;
'''Second group'''&lt;br /&gt;
&lt;br /&gt;
Serves to interact with the progress of the script. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* start emulation of the selected pawn script. Аfter startup is replaced by the emulation restart button&lt;br /&gt;
* stops pawn script emulation&lt;br /&gt;
* loading a script to a physical cube using the bluetooth protocol&lt;br /&gt;
&lt;br /&gt;
'''Third group'''&lt;br /&gt;
&lt;br /&gt;
'''''Project tab'''''&lt;br /&gt;
&lt;br /&gt;
In this tab you can choose one of two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* Pawn;&lt;br /&gt;
* Projector.&lt;br /&gt;
 &lt;br /&gt;
''Projector mode''&lt;br /&gt;
&lt;br /&gt;
The projector is used to transfer images from a computer or mobile device to the WOWCube via the Bluetooth protocol.&lt;br /&gt;
&lt;br /&gt;
The projector in the WOWCube Emulator is used for prototyping and faster development of web-projector applications.&lt;br /&gt;
&lt;br /&gt;
''Pawn Mode''&lt;br /&gt;
&lt;br /&gt;
In this mode, you can:&lt;br /&gt;
&lt;br /&gt;
* select the path to the projects folder&lt;br /&gt;
* select a startup project&lt;br /&gt;
* view additional data for a running project&lt;br /&gt;
&lt;br /&gt;
'''''View tab'''''&lt;br /&gt;
&lt;br /&gt;
The Sound adjusts the overall volume.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_sound.png]]&lt;br /&gt;
&lt;br /&gt;
In the Emulation, the transparency of the overlay is adjusted. The overlay displays on each module its current number, screen and adjacent modules.&lt;br /&gt;
&lt;br /&gt;
The Limit FPS slider allows you to limit the frame rate in the application running on the emulator.&lt;br /&gt;
&lt;br /&gt;
If necessary, it is possible to configure the simulation of lost packets during transmission.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_emulation.png]]&lt;br /&gt;
 &lt;br /&gt;
In the CubeNet, the transparency and the size of the cube unfolding are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_CubeNet.png]]&lt;br /&gt;
&lt;br /&gt;
In the Scene, the removal of the camera, the field of view, the backdrop are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_scene.png]]&lt;br /&gt;
&lt;br /&gt;
'''''Settings Tab'''''&lt;br /&gt;
&lt;br /&gt;
This is where the PAWN compiler path and python path are selected. &lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_settings_tab.png]]&lt;br /&gt;
&lt;br /&gt;
'''Fourth group'''&lt;br /&gt;
&lt;br /&gt;
Contains tabs for displaying script assembly logs and tabs with the console of each module separately.&lt;br /&gt;
&lt;br /&gt;
===Controls===&lt;br /&gt;
&lt;br /&gt;
LMB on a cube - rotation of the sides.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) on a cube - tilt the cube.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) past the cube - rotate the camera.&lt;br /&gt;
&lt;br /&gt;
Mouse wheel - zoom out / zoom in the camera.&lt;br /&gt;
&lt;br /&gt;
==Quick start==&lt;br /&gt;
&lt;br /&gt;
Go to https://github.com/wowcube/WOWCube_apps_examples&lt;br /&gt;
&lt;br /&gt;
Clone to the necessary folder.&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator.&lt;br /&gt;
&lt;br /&gt;
In ''Project'' tab switch Pawn mode.&lt;br /&gt;
&lt;br /&gt;
Specify ''Project path'' to the folder with examples.&lt;br /&gt;
&lt;br /&gt;
Under ''Run configuration'' choose example project.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_UI.png&amp;diff=164</id>
		<title>File:WOWCube Emulator UI.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_UI.png&amp;diff=164"/>
		<updated>2021-06-22T05:54:41Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: Raccoon pirate uploaded a new version of File:WOWCube Emulator UI.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Basic elements of emulator.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=163</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=163"/>
		<updated>2021-06-17T10:13:19Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 256 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 256 bytes.&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[GAME_SAVE_SIZE];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[GAME_SAVE_SIZE - 1] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sound functions===&lt;br /&gt;
====abi_CMD_PLAYSND====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_PLAYSND(const id, const volume)&lt;br /&gt;
Description:&lt;br /&gt;
: Play chosen sound with a given volume.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''id''&lt;br /&gt;
:: Sound serial number in the application package.&lt;br /&gt;
: ''volume''&lt;br /&gt;
:: The sound volume.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=162</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=162"/>
		<updated>2021-06-17T08:44:08Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 256 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 256 bytes.&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[GAME_SAVE_SIZE];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[GAME_SAVE_SIZE - 1] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=161</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=161"/>
		<updated>2021-06-17T08:42:57Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: /* abi_CMD_SAVE_STATE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 256 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 256 bytes.&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[8];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[7] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=160</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=160"/>
		<updated>2021-06-16T12:01:37Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete.&lt;br /&gt;
[[File:Highlight_Latest_Python_3_Release_link.png]]&lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
[[File:Python_installation_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
[[File:Python_disable_path_length_limit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing libraries'''&lt;br /&gt;
&lt;br /&gt;
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.&lt;br /&gt;
&lt;br /&gt;
[[File:Start_menu_with_PowerShell.png]]&lt;br /&gt;
&lt;br /&gt;
Type command &amp;quot;pip install intelhex pillow&amp;quot; and press enter. &lt;br /&gt;
[[File:Intelhex_and_pillow_installation.png]]&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
''pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow''&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file, drag the WOWCube Emulator application into the Applications folder. &lt;br /&gt;
[[File:Installation_on_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application.&lt;br /&gt;
[[File:Error_message_macOS_emulator_installation.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Terminal_window_in_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
In the terminal, write the command ''/ Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube'' and press enter.&lt;br /&gt;
&lt;br /&gt;
If the following error occurs&lt;br /&gt;
&lt;br /&gt;
''/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube''&lt;br /&gt;
&lt;br /&gt;
Then run the following command ''xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/''. It will output errors Permission Denied, but they are expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
For macOS version below Catalina open a terminal, install and download Homebrew&lt;br /&gt;
&lt;br /&gt;
''/ bin / bash -c &amp;quot;$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Homebrew is a package manager that lets you install Open Source applications.&lt;br /&gt;
&lt;br /&gt;
Next, install Python 3 and Pip&lt;br /&gt;
&lt;br /&gt;
''brew install python3''&lt;br /&gt;
&lt;br /&gt;
''brew cask install python3''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.&lt;br /&gt;
&lt;br /&gt;
''python3 -V''&lt;br /&gt;
&lt;br /&gt;
This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute&lt;br /&gt;
&lt;br /&gt;
''python -V''&lt;br /&gt;
&lt;br /&gt;
If it displays “Python 2.x.x”, then Python 3 is not installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install pip:&lt;br /&gt;
&lt;br /&gt;
''curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3''&lt;br /&gt;
&lt;br /&gt;
[[File:Check_for_python_and_installing_pip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing labraries'''&lt;br /&gt;
&lt;br /&gt;
Install IntelHex and Pillow libraries.&lt;br /&gt;
&lt;br /&gt;
''pip3 install pillow intelhex''&lt;br /&gt;
&lt;br /&gt;
==Starting WOWCube Emulator==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator by clicking on shortcut on desktop.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_shortcut_windows.png]]&lt;br /&gt;
&lt;br /&gt;
On first launch, a warning from the firewall will appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_security_alert_first_emulator_launch.png]]&lt;br /&gt;
&lt;br /&gt;
Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open terminal and enter ''WOWCube Emulator'' then and press Enter.&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator interface==&lt;br /&gt;
&lt;br /&gt;
There are 4 main groups of widgets in the WOWCube Emulator interface.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_UI.png]]&lt;br /&gt;
&lt;br /&gt;
'''First group'''&lt;br /&gt;
&lt;br /&gt;
Contains links for interacting with the cube module. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* simulates the shaking of a cube&lt;br /&gt;
* returns the cube module to its original state (restoring rotations and position)&lt;br /&gt;
* rotates a random side of the cube&lt;br /&gt;
&lt;br /&gt;
'''Second group'''&lt;br /&gt;
&lt;br /&gt;
Serves to interact with the progress of the script. Buttons from left to right:&lt;br /&gt;
&lt;br /&gt;
* start emulation of the selected pawn script. Аfter startup is replaced by the emulation restart button&lt;br /&gt;
* stops pawn script emulation&lt;br /&gt;
* loading a script to a physical cube using the bluetooth protocol&lt;br /&gt;
&lt;br /&gt;
'''Third group'''&lt;br /&gt;
&lt;br /&gt;
'''''Project tab'''''&lt;br /&gt;
&lt;br /&gt;
In this tab you can choose one of two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* Pawn;&lt;br /&gt;
* Projector.&lt;br /&gt;
 &lt;br /&gt;
''Projector mode''&lt;br /&gt;
&lt;br /&gt;
The projector is used to transfer images from a computer or mobile device to the WOWCube via the Bluetooth protocol.&lt;br /&gt;
&lt;br /&gt;
The projector in the WOWCube Emulator is used for prototyping and faster development of web-projector applications.&lt;br /&gt;
&lt;br /&gt;
''Pawn Mode''&lt;br /&gt;
&lt;br /&gt;
In this mode, you can:&lt;br /&gt;
&lt;br /&gt;
* select the path to the projects folder&lt;br /&gt;
* select a startup project&lt;br /&gt;
* view additional data for a running project&lt;br /&gt;
&lt;br /&gt;
'''''View tab'''''&lt;br /&gt;
&lt;br /&gt;
The Sound adjusts the overall volume.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_sound.png]]&lt;br /&gt;
&lt;br /&gt;
In the Emulation, the transparency of the overlay is adjusted. The overlay displays on each module its current number, screen and adjacent modules.&lt;br /&gt;
&lt;br /&gt;
The Limit FPS slider allows you to limit the frame rate in the application running on the emulator.&lt;br /&gt;
&lt;br /&gt;
If necessary, it is possible to configure the simulation of lost packets during transmission.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_emulation.png]]&lt;br /&gt;
 &lt;br /&gt;
In the CubeNet, the transparency and the size of the cube unfolding are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_CubeNet.png]]&lt;br /&gt;
&lt;br /&gt;
In the Scene, the removal of the camera, the field of view, the backdrop are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_view_tab_scene.png]]&lt;br /&gt;
&lt;br /&gt;
'''''Settings Tab'''''&lt;br /&gt;
&lt;br /&gt;
This is where the PAWN compiler path and python path are selected. &lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_settings_tab.png]]&lt;br /&gt;
&lt;br /&gt;
'''Fourth group'''&lt;br /&gt;
&lt;br /&gt;
Contains tabs for displaying script assembly logs and tabs with the console of each module separately.&lt;br /&gt;
&lt;br /&gt;
===Controls===&lt;br /&gt;
&lt;br /&gt;
LMB on a cube - rotation of the sides.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) on a cube - tilt the cube.&lt;br /&gt;
&lt;br /&gt;
RMB (or Ctrl + LMB) past the cube - rotate the camera.&lt;br /&gt;
&lt;br /&gt;
Mouse wheel - zoom out / zoom in the camera.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_settings_tab.png&amp;diff=159</id>
		<title>File:WOWCube Emulator settings tab.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_settings_tab.png&amp;diff=159"/>
		<updated>2021-06-16T11:57:36Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Settings tab in emulator.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Settings tab in emulator.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_view_tab_scene.png&amp;diff=158</id>
		<title>File:WOWCube Emulator view tab scene.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_view_tab_scene.png&amp;diff=158"/>
		<updated>2021-06-16T11:51:56Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Scene settings in view tab.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Scene settings in view tab.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_view_tab_CubeNet.png&amp;diff=157</id>
		<title>File:WOWCube Emulator view tab CubeNet.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_view_tab_CubeNet.png&amp;diff=157"/>
		<updated>2021-06-16T11:50:21Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. CubeNet setting in view tab.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. CubeNet setting in view tab.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_view_tab_emulation.png&amp;diff=156</id>
		<title>File:WOWCube Emulator view tab emulation.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_view_tab_emulation.png&amp;diff=156"/>
		<updated>2021-06-16T11:46:04Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Emulation settings in view tab.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Emulation settings in view tab.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_view_tab_sound.png&amp;diff=155</id>
		<title>File:WOWCube Emulator view tab sound.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_view_tab_sound.png&amp;diff=155"/>
		<updated>2021-06-16T11:43:48Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Sound settings in view tab.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Sound settings in view tab.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_UI.png&amp;diff=154</id>
		<title>File:WOWCube Emulator UI.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_UI.png&amp;diff=154"/>
		<updated>2021-06-16T10:36:46Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Basic elements of emulator.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Basic elements of emulator.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=153</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=153"/>
		<updated>2021-06-16T09:40:58Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete.&lt;br /&gt;
[[File:Highlight_Latest_Python_3_Release_link.png]]&lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
[[File:Python_installation_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
[[File:Python_disable_path_length_limit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing libraries'''&lt;br /&gt;
&lt;br /&gt;
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.&lt;br /&gt;
&lt;br /&gt;
[[File:Start_menu_with_PowerShell.png]]&lt;br /&gt;
&lt;br /&gt;
Type command &amp;quot;pip install intelhex pillow&amp;quot; and press enter. &lt;br /&gt;
[[File:Intelhex_and_pillow_installation.png]]&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
''pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow''&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file, drag the WOWCube Emulator application into the Applications folder. &lt;br /&gt;
[[File:Installation_on_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
If the .dmg file was downloaded not in the App Store, then an error will pop up when starting the application.&lt;br /&gt;
[[File:Error_message_macOS_emulator_installation.png]]&lt;br /&gt;
&lt;br /&gt;
To fix this error, you need to open the Terminal application. It can be opened in a number of ways: with Siri, or through Launchpad, or through the Finder, or by pressing Command + Space bar and pressing the Enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Terminal_window_in_macOS.png]]&lt;br /&gt;
&lt;br /&gt;
In the terminal, write the command ''/ Applications / WOWCube \ Emulator.app/Contents/MacOS/bin/wowcube'' and press enter.&lt;br /&gt;
&lt;br /&gt;
If the following error occurs&lt;br /&gt;
&lt;br /&gt;
''/ usr / bin / env: bad interpreter: Operation not permitted, or zsh: operation not permitted: / Applications / WOWCube Emulator.app/Contents/MacOS/bin/wowcube''&lt;br /&gt;
&lt;br /&gt;
Then run the following command ''xattr -rd com.apple.quarantine / Applications / WOWCube \ Emulator.app/''. It will output errors Permission Denied, but they are expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing Python'''&lt;br /&gt;
&lt;br /&gt;
For macOS version below Catalina open a terminal, install and download Homebrew&lt;br /&gt;
&lt;br /&gt;
''/ bin / bash -c &amp;quot;$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Homebrew is a package manager that lets you install Open Source applications.&lt;br /&gt;
&lt;br /&gt;
Next, install Python 3 and Pip&lt;br /&gt;
&lt;br /&gt;
''brew install python3''&lt;br /&gt;
&lt;br /&gt;
''brew cask install python3''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS by Catalina. First you need to make sure that python is installed and that it is the correct version.&lt;br /&gt;
&lt;br /&gt;
''python3 -V''&lt;br /&gt;
&lt;br /&gt;
This command should print “Python 3.x.x”. If the command did not display anything, or was not found, try to execute&lt;br /&gt;
&lt;br /&gt;
''python -V''&lt;br /&gt;
&lt;br /&gt;
If it displays “Python 2.x.x”, then Python 3 is not installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install pip:&lt;br /&gt;
&lt;br /&gt;
''curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3''&lt;br /&gt;
&lt;br /&gt;
[[File:Check_for_python_and_installing_pip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Installing labraries'''&lt;br /&gt;
&lt;br /&gt;
Install IntelHex and Pillow libraries.&lt;br /&gt;
&lt;br /&gt;
''pip3 install pillow intelhex''&lt;br /&gt;
&lt;br /&gt;
==Starting WOWCube Emulator==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Launch WOWCube Emulator by clicking on shortcut on desktop.&lt;br /&gt;
&lt;br /&gt;
[[File:WOWCube_Emulator_shortcut_windows.png]]&lt;br /&gt;
&lt;br /&gt;
On first launch, a warning from the firewall will appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_security_alert_first_emulator_launch.png]]&lt;br /&gt;
&lt;br /&gt;
Allow access. WOWCube Emulator uses local ports for communication between the processes it creates, as well as for projector mode.&lt;br /&gt;
&lt;br /&gt;
===macOS===&lt;br /&gt;
&lt;br /&gt;
Open terminal and enter ''WOWCube Emulator'' then and press Enter.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:Windows_security_alert_first_emulator_launch.png&amp;diff=152</id>
		<title>File:Windows security alert first emulator launch.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:Windows_security_alert_first_emulator_launch.png&amp;diff=152"/>
		<updated>2021-06-16T09:37:34Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Firewall warning message on first WOWCube Emulator launch.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Firewall warning message on first WOWCube Emulator launch.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_shortcut_windows.png&amp;diff=151</id>
		<title>File:WOWCube Emulator shortcut windows.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:WOWCube_Emulator_shortcut_windows.png&amp;diff=151"/>
		<updated>2021-06-16T09:33:24Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. WOWCube Emulator application shortcut.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. WOWCube Emulator application shortcut.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:Check_for_python_and_installing_pip.png&amp;diff=150</id>
		<title>File:Check for python and installing pip.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:Check_for_python_and_installing_pip.png&amp;diff=150"/>
		<updated>2021-06-16T09:06:09Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Installing pip on macOS.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Installing pip on macOS.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:Terminal_window_in_macOS.png&amp;diff=149</id>
		<title>File:Terminal window in macOS.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:Terminal_window_in_macOS.png&amp;diff=149"/>
		<updated>2021-06-16T08:21:39Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. MacOS terminal window.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. MacOS terminal window.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:Error_message_macOS_emulator_installation.png&amp;diff=148</id>
		<title>File:Error message macOS emulator installation.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:Error_message_macOS_emulator_installation.png&amp;diff=148"/>
		<updated>2021-06-16T08:00:04Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Error message when WOWCube emulator fails to launch on macOS.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Error message when WOWCube emulator fails to launch on macOS.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:Installation_on_macOS.png&amp;diff=147</id>
		<title>File:Installation on macOS.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:Installation_on_macOS.png&amp;diff=147"/>
		<updated>2021-06-16T07:54:30Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Installation WOWCube Emulator on macOS.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Installation WOWCube Emulator on macOS.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=146</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=146"/>
		<updated>2021-06-16T07:39:20Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installing Python&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete.&lt;br /&gt;
[[File:Highlight_Latest_Python_3_Release_link.png]]&lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
[[File:Python_installation_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
[[File:Python_disable_path_length_limit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installing libraries&lt;br /&gt;
&lt;br /&gt;
To install the dependencies, you need to start the terminal. Go to Start menu (or press Windows key + X) and select Windows PowerShell.&lt;br /&gt;
&lt;br /&gt;
[[File:Start_menu_with_PowerShell.png]]&lt;br /&gt;
&lt;br /&gt;
Type command &amp;quot;pip install intelhex pillow&amp;quot; and press enter. &lt;br /&gt;
[[File:Intelhex_and_pillow_installation.png]]&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:Intelhex_and_pillow_installation.png&amp;diff=145</id>
		<title>File:Intelhex and pillow installation.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:Intelhex_and_pillow_installation.png&amp;diff=145"/>
		<updated>2021-06-16T07:37:46Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Python dependencies installation precess.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Python dependencies installation precess.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:Start_menu_with_PowerShell.png&amp;diff=144</id>
		<title>File:Start menu with PowerShell.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:Start_menu_with_PowerShell.png&amp;diff=144"/>
		<updated>2021-06-16T07:13:44Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Windows PowerShell in Start menu.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Windows PowerShell in Start menu.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:Python_disable_path_length_limit.png&amp;diff=143</id>
		<title>File:Python disable path length limit.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:Python_disable_path_length_limit.png&amp;diff=143"/>
		<updated>2021-06-16T07:01:11Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Disable path length limit for python libraries.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Disable path length limit for python libraries.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:Python_installation_configuration.png&amp;diff=142</id>
		<title>File:Python installation configuration.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:Python_installation_configuration.png&amp;diff=142"/>
		<updated>2021-06-16T06:50:53Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Recommended configuration for installing python.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Recommended configuration for installing python.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=File:Highlight_Latest_Python_3_Release_link.png&amp;diff=141</id>
		<title>File:Highlight Latest Python 3 Release link.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=File:Highlight_Latest_Python_3_Release_link.png&amp;diff=141"/>
		<updated>2021-06-16T06:26:01Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: WOWCube Emulator guide. Highlighted link to python 3 for windows.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WOWCube Emulator guide. Highlighted link to python 3 for windows.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK&amp;diff=140</id>
		<title>SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK&amp;diff=140"/>
		<updated>2021-06-15T13:21:15Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK/Framework&lt;br /&gt;
&lt;br /&gt;
*[[pawn]]&lt;br /&gt;
&lt;br /&gt;
==WOWCube Emulator installation==&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Launch the wowcube-sdk.exe installer and follow the steps of the installer.&lt;br /&gt;
&lt;br /&gt;
Installing Dependencies (for Pawn Application Developers) &lt;br /&gt;
To run scripts written in the Pawn language, you need to install Python 3, Pip, IntelHex, and Pillow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installing Python&lt;br /&gt;
&lt;br /&gt;
Go to the site https://www.python.org/downloads/windows/, click on the &amp;quot;Latest Python 3 Release&amp;quot; link, wait for the download to complete &lt;br /&gt;
&lt;br /&gt;
Run the downloaded Python installer, select the &amp;quot;Add Python to PATH&amp;quot; checkbox (without it, the path to Python will need to be specified in full), and then click &amp;quot;Install Now&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Python 3 will be installed in &amp;quot;%LOCALAPPDATA%\Programs\Python&amp;quot;. After installation, it will offer to remove the 260-character limit on the PATH length. Click. We complete the installation. Some Python libraries may not work or work incorrectly due to the standard 260 character limit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installing libraries&lt;br /&gt;
&lt;br /&gt;
Open any terminal. This can be done in different ways: by Right-clicking on the &amp;quot;Start&amp;quot; button, or by the keyboard shortcut ⊞ (Win) + X (English).&lt;br /&gt;
&lt;br /&gt;
Open the Windows administrative menu.&lt;br /&gt;
&lt;br /&gt;
In it, select Windows PowerShell or Command Prompt (Command Prompt).&lt;br /&gt;
&lt;br /&gt;
A terminal opens. In the terminal, you need to write a command &amp;quot;pip install intelhex pillow&amp;quot; and press the Enter/↵/Return button on the keyboard:&lt;br /&gt;
&lt;br /&gt;
This command will download and install the IntelHex and Pillow dependencies. If the installation is successful, a corresponding message will be displayed. &lt;br /&gt;
&lt;br /&gt;
If your company uses a proxy, then you need to add the --proxy option to the command above. The option has the following format:&lt;br /&gt;
&lt;br /&gt;
[user: password @] proxy.server: port&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
pip install --proxy = http: //proxy.jf.intel.com: 911 intelhex pillow&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=About&amp;diff=139</id>
		<title>About</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=About&amp;diff=139"/>
		<updated>2021-06-15T12:08:02Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== WOWCube® System==&lt;br /&gt;
&lt;br /&gt;
WOWCube® system is the World’s first mixed-reality entertainment device that combines the best from classical 3D puzzle cube and video games and delivers an unprecedented immersive experience where virtual gameplay is controlled by physically tilting, twisting, and shaking the device.&lt;br /&gt;
&lt;br /&gt;
It’s an interesting and exciting gadget with tons of games and features, like smartphones and consoles.&lt;br /&gt;
&lt;br /&gt;
At the same time, it’s a Smart Educational platform for cognitive and motor to brain development for kids and the whole family designed to keep it far from the eyes thinking in 3 dimensions.&lt;br /&gt;
&lt;br /&gt;
It is a stand-alone digital device that uses a Tangible interface and Mixed Reality to create an exciting development environment with unusual characteristics in which puzzle-like dynamic games can work.&lt;br /&gt;
&lt;br /&gt;
== Cubios Inc ==&lt;br /&gt;
&lt;br /&gt;
Cubios Inc. is a company based in Novato, CA which focuses on hi-tech consumer robotic toys and entertainment game platforms design, development, marketing, and distribution. Cubios inc. was founded as an independent research, development, and manufacturing company focused on cutting-edge technologies. Cubios Studio is a game studio for Digital Apps &amp;amp; Widgets.&lt;br /&gt;
&lt;br /&gt;
'''Ilya Osipov'''&lt;br /&gt;
President&amp;amp;Founder&lt;br /&gt;
&lt;br /&gt;
''' Savva Osipov'''&lt;br /&gt;
Idea Creator, Evangelist&lt;br /&gt;
&lt;br /&gt;
'''Max Filin'''&lt;br /&gt;
CEO&lt;br /&gt;
&lt;br /&gt;
== Inventors ==&lt;br /&gt;
&lt;br /&gt;
Initially, the idea of the product belongs to [[Savva Osipov]] and [[Ilya Osipov]]. Which were later joined by [[Semyon Orlov]], [[Max Filin]] and other team members.&lt;br /&gt;
&lt;br /&gt;
The idea was invented on September 10, 2016 and inspired by the products of Sifteo and Rubik's Cube&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
:Semyon Orlov - Главный Инженер, со-изобретатель магнитных коннекторов и базовой конструкции куба, автор идеи игр ...&lt;br /&gt;
:Max Filin - CEO и операционный директор компании, автор идеи игр Bonbon, BluePrint &lt;br /&gt;
:Valentine Zubkov - Главный дизанер компании. Автор внешнего вида устройства и фирменного стиля компании&lt;br /&gt;
:...&lt;br /&gt;
&lt;br /&gt;
== How it was invented? ==&lt;br /&gt;
&lt;br /&gt;
As Ilya Osipov likes to say he has always loved 3D puzzles. One of the mechanical puzzles he developed won a global puzzle design competition prize.  &lt;br /&gt;
&lt;br /&gt;
The whole house was full of different puzzles, moreover, he was engaged in IT for many years, and he and his son Savva took part in a computer contest based on Arduino, and Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
Ilya's son, Savva Osipov, who was 12 years old, gave the idea of the WOWCube® system. &lt;br /&gt;
&lt;br /&gt;
Ilya and Savva discussed the idea of Sifteo, its concept, pros, and cons. Savva noticed that it would be more interesting to make screens not on separate cubes, but on a single Rubik’s cube. And thus the game characters could run from screen to screen. The way to control them would be the turns, as in the Rubik’s cube. &lt;br /&gt;
&lt;br /&gt;
Ilya thought that even though it’s more difficult but it would definitely be more interesting. He considered the idea and decided that he could build such a device.&lt;br /&gt;
&lt;br /&gt;
The most difficult part was the topology of the device. Not only did it need to rotate mechanically like a Rubik’s Cube, but it also needed to do so while supporting electrical and mathematical integrity.&lt;br /&gt;
&lt;br /&gt;
* How to place microprocessors inside the device? &lt;br /&gt;
&lt;br /&gt;
* How to make the parts understand their current relative position? &lt;br /&gt;
&lt;br /&gt;
* How to provide data transfer and synchronize operations? &lt;br /&gt;
&lt;br /&gt;
* How to make the environment work as a single device while performing distributed computing? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the end, there are 8 processors in the device. All this required an unusual approach. &lt;br /&gt;
&lt;br /&gt;
When Ilya wrote the first C++ program for an early prototype, he was literally dizzy.&lt;br /&gt;
&lt;br /&gt;
It was necessary to create mapping matrices of the faces of different screens and to ensure their re-calculation after any rotation done by the user. &lt;br /&gt;
&lt;br /&gt;
The first thing done was an analog of the game Digger. When the Digger began to successfully run from screen to screen, it became clear that the concept was right, and everything was feasible.&lt;br /&gt;
&lt;br /&gt;
There was also a very big question of how to make reliable connections between the parts of the device. &lt;br /&gt;
&lt;br /&gt;
Inspired by Apple’s MagSafe, Ilya designed magnetic connections with self-orientating magnetic contacts, which, unlike MagSafe’s male to female connections, had unisex connections. This allowed any part inside the cube to connect evenly and perfectly to each other, no matter how the cube is rotated.&lt;br /&gt;
All these were just conceptual models. &lt;br /&gt;
&lt;br /&gt;
They received practical implementation when the chief engineer, Semyon Orlov, joined the project. He applied Ilya's ideas in practice to finalize the prototype.&lt;br /&gt;
&lt;br /&gt;
The idea came up in late 2016. Then it took time to analyze the idea. The first prototype based on Arduino was made in Spring 2017. It was printed on an in-house 3D printer just to prove the concept. &lt;br /&gt;
&lt;br /&gt;
In total, 4 basic prototypes and dozens of variations were made.&lt;br /&gt;
&lt;br /&gt;
== Publications ==&lt;br /&gt;
&lt;br /&gt;
Osipov, I. V. (2017). &amp;lt;b&amp;gt;Cubios Transreality Puzzle as a Mixed Reality Object&amp;lt;/b&amp;gt;. In &amp;lt;i&amp;gt;International Journal of Virtual and Augmented Reality (IJVAR)&amp;lt;/i&amp;gt;, 1(2), 1-17.&lt;br /&gt;
&lt;br /&gt;
Osipov, I. V. (2017). &amp;lt;b&amp;gt;Transreality puzzle as new genres of entertainment technology&amp;lt;/b&amp;gt;. In &amp;lt;i&amp;gt;arXiv preprint arXiv:1705.03973&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Osipov, I. V., &amp;amp; Nikulchev, E. (2018, November). &amp;lt;b&amp;gt;WOWCube Puzzle: A Transreality Object of Mixed Reality.&amp;quot;&amp;lt;/b&amp;gt; In &amp;lt;i&amp;gt;Proceedings of the Future Technologies Conference. Springer&amp;lt;/i&amp;gt;, Cham.&lt;br /&gt;
&lt;br /&gt;
Osipov, I. V., Nikulchev, E., Egoryshkin, I., &amp;amp; Orlov, S. (2018). &amp;lt;b&amp;gt;Gamification Device Wowcube: Design And Program Environment.&amp;lt;/b&amp;gt; In &amp;lt;i&amp;gt;ICPE 2018-International Conference on Psychology and Education&amp;lt;/i&amp;gt; (pp. 496-505).&lt;br /&gt;
&lt;br /&gt;
Osipov, I. V., &amp;amp; Nikulchev, E. (2018). &amp;lt;b&amp;gt;Review puzzles and construction sets falling under the category of augmented reality games&amp;lt;/b&amp;gt;. In &amp;lt;i&amp;gt;In ITM Web of Conferences (Vol. 18, p. 02003). EDP Sciences.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Orlov, S. O., Egoryshkin, I. S., &amp;amp; Nikulchev, E. V. (2020). &amp;lt;b&amp;gt;Development of a game application for a custom eight-processor device with a tangible interface&amp;lt;/b&amp;gt;. In &amp;lt;i&amp;gt;International Journal of Open Information Technologies&amp;lt;/i&amp;gt;, 8(3), 40-46.&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=Development&amp;diff=138</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=Development&amp;diff=138"/>
		<updated>2021-06-15T12:06:04Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a section about developing applications for WOWCUBE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WOWCUBE supports several approaches to programming content for it:&lt;br /&gt;
&lt;br /&gt;
:1. Development of specialized applets (cublets) that are executed and stored on a cube as on a stand-alone device:&lt;br /&gt;
&lt;br /&gt;
:It can be carried out in the PAWN language. PAWN is a derivative of “Small C” (See [https://github.com/compuphase/pawn/blob/master/doc/Pawn_Language_Guide.pdf Pawn_Language_Guide.pdf], and [https://wiki.alliedmods.net/Pawn_Tutorial Pawn Tutorial])&lt;br /&gt;
&lt;br /&gt;
:[[API|WOWCUBE PAWN API]] - Guide to specific pawn cube functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:2. Development using [https://webassembly.org/ WebAssembly] ( based on wasm3 ) &lt;br /&gt;
:[[WASM|WOWCUBE WASM API]] - Guide to specific wasm cube functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:3. Development of programs for smartphones (or other external devices) transmitting data and graphics to the cube as to an external device, according to the protocol BlueTooth. We call this mode &amp;quot;Projector&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:4. Development using WOWCube Emulator. Software that allows you to develop games and applications for Wowcube without having a physical device.&lt;br /&gt;
&lt;br /&gt;
:[[SDK|WOWCUBE Emulator]] - Emulator Guide&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=137</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=137"/>
		<updated>2021-06-14T12:40:03Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 32 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 32 bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[8];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[7] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Topology functions===&lt;br /&gt;
====get cube/face====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_topCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_topFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_rightFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_bottomFaceN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftCubeN(const _cubeN, const _faceN)&lt;br /&gt;
  abi_leftFaceN(const _cubeN, const _faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Returns the cube / screen located at the top / bottom / left / right of the specified in parameters.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
Find diagonal face and cube&lt;br /&gt;
 new diagonalCube = CUBES_MAX;&lt;br /&gt;
 new diagonalFace = FACES_MAX;&lt;br /&gt;
 new topCube = abi_topCubeN(cube, face);&lt;br /&gt;
 new topFace = abi_topFaceN(cube, face);&lt;br /&gt;
 if (topCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
     diagonalCube = abi_topCubeN(topCube, topFace);&lt;br /&gt;
     if (diagonalCube &amp;lt; CUBES_MAX) {&lt;br /&gt;
         diagonalFace = abi_topFaceN(topCube, topFace);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=API&amp;diff=136</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=API&amp;diff=136"/>
		<updated>2021-06-14T11:42:10Z</updated>

		<summary type="html">&lt;p&gt;Raccoon pirate: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This is a beta version, API changes can be made without warning.}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
The main functions of the API are listed here, the features of the work of the environment are described&lt;br /&gt;
&lt;br /&gt;
==WOWCube Paradigms==&lt;br /&gt;
&lt;br /&gt;
WOWCube executes 8 copies of the byte-code of the script at the same time, providing functions for the interaction of scripts with each other, drawing functions, functions for accessing resources, and other specific functions. Each copy of the script has access to 3 displays. Resource scripts are packed into a package.&lt;br /&gt;
&lt;br /&gt;
==Pawn API==&lt;br /&gt;
===Graphic functions===&lt;br /&gt;
&lt;br /&gt;
====Graphics 2D acceleration (G2D)====&lt;br /&gt;
WOWCube provides the 2D acceleration interfaces to enhance gaming experience . Basically G2D engine allows to blend up to the 4 image layers at once with a HW acceleration. However there is no limit of layers, they are blended in a cascade. For example, if Pawn script requested 7 layers to be blended then 2 HW blending will occur:&lt;br /&gt;
[[File:Cascade.png|center|G2D cascading scheme]]&lt;br /&gt;
Result of the blending can be saved as an internal G2D resource or flushed immediately on the specified display. Internal G2D resources can be used as an usual bitmap primitive ([[API#abi_CMD_BITMAP|abi_CMD_BITMAP]]) or reused as an input for the next G2D action.&lt;br /&gt;
Basic coordinate principle:&lt;br /&gt;
[[File:G2d_coordinates.png|center|G2D coordinates sceme]]&lt;br /&gt;
Coordinates are limited from -2048 to 2047. Maximum layers size is 240x240.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_BITMAP=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(const resID, const width, const height, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_BITMAP and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended into internal G2D resource. This API is not intended for frequent usage. It is better suited for complex background generation on game initialization or dynamic resource modification triggered by rare game events.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource that will be generated from blending layers presented between abi_CMD_G2D_BEGIN_BITMAP and the subsequent [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]]. G2D engine can keep up to 3 different resources with IDs: 0, 1 and 2.&lt;br /&gt;
: ''width'' &lt;br /&gt;
:: Width of the resulting resource. G2D engine can keep resource of 240px width maximum.&lt;br /&gt;
: ''height'' &lt;br /&gt;
:: Height of the resulting resource. G2D engine can keep resource of 240px height maximum.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true, then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_BEGIN_DISPLAY=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(const display, const bool:replace)&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_BEGIN_DISPLAY and [[API#abi_CMD_G2D_END|abi_CMD_G2D_END]] delimits the group of layers to be blended directly into display framebuffer. Obviously this API is designed for rendering scene on game tick. This API is not limited by layers count as well as [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]. However it is strictly recommended to blend no more than 4 layers. Otherwise cascade blending will be initiated resulting in some FPS drop.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''display''&lt;br /&gt;
:: ID of the display which framebuffer will be used for blending. Each module have 3 displays with ID starting from 0.&lt;br /&gt;
: ''replace'' &lt;br /&gt;
:: If true then an existing image will be replaced completely, otherwise it will be overwritten by reusing itself as a background layer.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_SPRITE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(const resID, const bool:g2d, const x, const y, const alpha, const color, const rotation, const mirror)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies game resource which will be used as a layer for blending.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''resID''&lt;br /&gt;
:: ID of the resource to be uses as a layer.&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: Indicates if an internal G2D resource is specified or not.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of the bitmap center to place on the layer.&lt;br /&gt;
: ''alpha''&lt;br /&gt;
:: Layer transparency in range between 0x00 and 0xFF, where 0x00 is a fully transparent layer.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Layer's source key - a color in ARGB8888 format to be avoided.&lt;br /&gt;
: ''rotation''&lt;br /&gt;
:: Clockwise rotation angle in degrees. It is possible to specify free angle, but only right angles have HW acceleration. Currently rotation only applicable for external resources.&lt;br /&gt;
: ''mirror''&lt;br /&gt;
:: Mirroring variant. Possible values are self-explained: MIRROR_BLANK, MIRROR_X, MIRROR_Y, MIRROR_XY.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_ADD_RECTANGLE=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(const x, const y, const width, const height, const color)&lt;br /&gt;
Description:&lt;br /&gt;
: Specifies rectangle area which will be used as layer of blending. This API is not intended for frequent usage, i.e. particles generation. It is better suited for changing image background or applying color mask.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''width''&lt;br /&gt;
:: Rectangle width.&lt;br /&gt;
: ''height''&lt;br /&gt;
:: Rectangle height.&lt;br /&gt;
: ''color''&lt;br /&gt;
:: Rectangle color in ARGB8888 format.&lt;br /&gt;
&lt;br /&gt;
=====abi_CMD_G2D_END=====&lt;br /&gt;
Syntax:&lt;br /&gt;
 abi_CMD_G2D_END()&lt;br /&gt;
Description:&lt;br /&gt;
: abi_CMD_G2D_END() and [[API#abi_CMD_G2D_BEGIN_BITMAP|abi_CMD_G2D_BEGIN_BITMAP]]/[[API#abi_CMD_G2D_BEGIN_DISPLAY|abi_CMD_G2D_BEGIN_DISPLAY]] delimits the group of layers to be blended. After abi_CMD_G2D_END call final blending will be initiated and results will be stored according to the begin comand.&lt;br /&gt;
&lt;br /&gt;
=====Examples=====&lt;br /&gt;
1. Render into inner G2D resource buffer #face and display it on the display #face. Please, note that last argument of abi_CMD_BITMAP is a `true` flag, which means G2D resource should be used:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_BITMAP(face, 240, 240, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_BITMAP(face, 120, 120, 0, MIRROR_BLANK, true);&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_REDRAW(face);&lt;br /&gt;
 ...&lt;br /&gt;
2. Render directly into display framebuffer #face. This will produce same result on display as example #1, but the generated image is not saved:&lt;br /&gt;
 ...&lt;br /&gt;
 abi_CMD_G2D_BEGIN_DISPLAY(face, true);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize0, 120 - animationSquareSize0, animationSquareSize0 * 2, animationSquareSize0 * 2, 0xdfff0000);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize1, 120 - animationSquareSize1, animationSquareSize1 * 2, animationSquareSize1 * 2, 0xdfffff00);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize2, 120 - animationSquareSize2, animationSquareSize2 * 2, animationSquareSize2 * 2, 0xdfff00ff);&lt;br /&gt;
 abi_CMD_G2D_ADD_RECTANGLE(120 - animationSquareSize3, 120 - animationSquareSize3, animationSquareSize3 * 2, animationSquareSize3 * 2, 0xdf00ffff);&lt;br /&gt;
 abi_CMD_G2D_ADD_SPRITE(resID, false, 120, 120, animationAlpha, 0x00000000, animationAngle, MIRROR_BLANK);&lt;br /&gt;
 abi_CMD_G2D_END();&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====Font drawing functions====&lt;br /&gt;
=====abi_CMD_TEXT=====&lt;br /&gt;
API:&lt;br /&gt;
  abi_CMD_TEXT(const text[], const fontResID, const x, const y, const scale, const angle, const r, const g, const b)&lt;br /&gt;
Description:&lt;br /&gt;
: Intended to render a system font or a custom font from resources with specified coordinates, scale and rotation at an arbitrary angle.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''text''&lt;br /&gt;
:: Array of chars.&lt;br /&gt;
: ''fontResID''&lt;br /&gt;
:: Custom font resource identifier. Provide ''-1'' to use system font resource.&lt;br /&gt;
: ''x'', ''y''&lt;br /&gt;
:: Coordinates of top left rectangle corner.&lt;br /&gt;
: ''scale'', ''angle''&lt;br /&gt;
:: Percentage scale and clockwise rotation angle in degrees. Max size of font is 200x200 px. (scale = 100%)&lt;br /&gt;
: ''r'', ''g'', ''b''&lt;br /&gt;
:: Font color in RGB format.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 new text[4] = ['A', 'p', 'p', '\0'];&lt;br /&gt;
 abi_CMD_TEXT(text, RES_ID_FONT, 90, 160, 16, current_angles[face], 255, 0, 0);&lt;br /&gt;
&lt;br /&gt;
====TEXTURE drawing functions====&lt;br /&gt;
=====abi_CMD_DYNAMIC_TEXTURE=====&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(const effectId = 1, const time = any value, const args[] = {0x04030201, 0x08070605, 0x00000A09}, const argsCount = 3, const bool:g2d = false)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Render a texture with chosen algorithm and parameters.&lt;br /&gt;
Arguments:&lt;br /&gt;
: ''effectId''&lt;br /&gt;
:: Define algorithm to render texture. &lt;br /&gt;
:: Available values : G2D_DYNAMIC_TEXTURE_MOSAIC &lt;br /&gt;
&lt;br /&gt;
: ''time ''&lt;br /&gt;
:: Current time value. Use any fixed value to static texture or set current time value in milliseconds to make texture alive.&lt;br /&gt;
: ''args'', ''argsCount''&lt;br /&gt;
:: Byte stream of algorithm settings it's aligned to 4 bytes, because of pawn supports only 32-bit values.&lt;br /&gt;
:: Size of array depends on algorithm. For example mosaic algorithm has size of settings equals 10 bytes , so we must use aligned 4 bytes - 12 bytes array and argsCount = 3&lt;br /&gt;
&lt;br /&gt;
: ''g2d''&lt;br /&gt;
:: false - Use pawn default buffer to draw texture.&lt;br /&gt;
:: true - Use g2d buffer to draw texture - not supported now.&lt;br /&gt;
&lt;br /&gt;
'''G2D_DYNAMIC_TEXTURE_MOSAIC''' alogrithm description&lt;br /&gt;
&lt;br /&gt;
:So in effect named 'mosaic' we have settings of 10 parameters each one 1 byte&lt;br /&gt;
&lt;br /&gt;
:Noise factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Time factors :&lt;br /&gt;
::factor x : values from 0 to 10&lt;br /&gt;
::factor y : values from 0 to 10&lt;br /&gt;
::factor xy : values from 0 to 10&lt;br /&gt;
:Color factors :&lt;br /&gt;
::r : values from 0 to 10&lt;br /&gt;
::g : values from 0 to 10&lt;br /&gt;
::b : values from 0 to 10&lt;br /&gt;
:Zoom factor :&lt;br /&gt;
::zoom  values from 0 to 10&lt;br /&gt;
&lt;br /&gt;
For example we want to set all parameters above with values in order 1,2,3,4,5,6,7,8,9,10. Take in attention that each parameter is 1 byte we must make array of 32-bit values&lt;br /&gt;
0x04030201, 0x08070605, 0x00000A09&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mosaic_effect_settings = { 0x04030201, 0x08070605, 0x00000A09  };&lt;br /&gt;
 mosaic_effect_settings_length = 3;&lt;br /&gt;
 abi_CMD_DYNAMIC_TEXTURE(G2D_DYNAMIC_TEXTURE_MOSAIC , currentTime, mosaic_effect_settings, mosaic_effect_settings_length);&lt;br /&gt;
&lt;br /&gt;
===Motion sensors===&lt;br /&gt;
====abi_MTD_GetFaceAccel(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceAccelX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceAccelZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the value of acceleration along the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetFaceGyro(X/Y/Z)====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetFaceGyroX(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroY(const faceN)&lt;br /&gt;
  abi_MTD_GetFaceGyroZ(const faceN)&lt;br /&gt;
Description:&lt;br /&gt;
: Get the gyro value around the requested axis.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''faceN''&lt;br /&gt;
:: Number of the module face for which requested axis is belong.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapFace====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapFace()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the face ID which was tapped. ID is not a face number which is used for drawing in abi_CMD_G2D_BEGIN_DISPLAY or abi_CMD_REDRAW, but that number can be calculated by subtracting by one from ID value. See possible values below.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''MTD_TAP_DIRECTION_NONE = 0''&lt;br /&gt;
:: Indicates that the module wan not tapped.&lt;br /&gt;
: ''MTD_TAP_DIRECTION_X = 1''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Y = 2''&lt;br /&gt;
: ''MTD_TAP_DIRECTION_Z = 3''&lt;br /&gt;
:: Indicated direction of tap.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_IsTapOpposite====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_IsTapOpposite()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the flag if the tap was detected in opposite direction.&lt;br /&gt;
&lt;br /&gt;
====abi_MTD_GetTapsCount====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_MTD_GetTapsCount()&lt;br /&gt;
Description:&lt;br /&gt;
: Get the count of subsequent taps. Tap is treated as a subsequent if it was detected within predefined interval (350ms). Count will be zero until sequence is finished, i.e. next tap is not detected within interval.&lt;br /&gt;
&lt;br /&gt;
====abi_checkShake====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_checkShake()&lt;br /&gt;
Description:&lt;br /&gt;
: Checks if the number of shakes of the cube was more than a certain threshold then exits the script &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Flash the face on which tap was detected. Print an ID of that face. Color of the flash depends on taps count: red - one tap, green - two taps and blue - three.&lt;br /&gt;
 new delay = 0;&lt;br /&gt;
 new color = 0x000000; &lt;br /&gt;
 ONTICK() {&lt;br /&gt;
   if (!color) {&lt;br /&gt;
     switch (abi_MTD_GetTapsCount()) {&lt;br /&gt;
     case 1:&lt;br /&gt;
       color = 0xff0000;&lt;br /&gt;
     case 2:&lt;br /&gt;
       color = 0x00ff00;&lt;br /&gt;
     case 3:&lt;br /&gt;
       color = 0x0000ff;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (delay % 25 == 0) {&lt;br /&gt;
     for (new i = 0; i &amp;lt; FACES_MAX; i++) {&lt;br /&gt;
       if (i == (abi_MTD_GetTapFace() - 1)) {&lt;br /&gt;
         abi_CMD_FILL_2(color);&lt;br /&gt;
         color = 0x000000;&lt;br /&gt;
         switch (abi_MTD_GetTapFace()) {&lt;br /&gt;
         case 1:&lt;br /&gt;
           abi_CMD_TEXT(['1', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 2:&lt;br /&gt;
           abi_CMD_TEXT(['2', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         case 3:&lt;br /&gt;
           abi_CMD_TEXT(['3', '\0'], -1, 120, 120, 14, 0, 0xff, 0xff, 0xff);&lt;br /&gt;
         }&lt;br /&gt;
       } else {&lt;br /&gt;
         abi_CMD_FILL(0, 0, 0);&lt;br /&gt;
       }&lt;br /&gt;
       abi_CMD_REDRAW(i);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   delay++;&lt;br /&gt;
 }&lt;br /&gt;
2. Exit from script&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
    if (abi_cubeN == 0) {&lt;br /&gt;
        abi_checkShake();&lt;br /&gt;
    }&lt;br /&gt;
    // Script logic&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Save/load functions===&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_SAVE_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  bool:abi_CMD_SAVE_STATE(const data[], size = sizeof(data))&lt;br /&gt;
Description:&lt;br /&gt;
: Save maximum 32 bytes of data to wowcube flash memory.&lt;br /&gt;
Arguments&lt;br /&gt;
: ''data''&lt;br /&gt;
:: Game data to save.&lt;br /&gt;
: ''size''&lt;br /&gt;
:: Size of game data.&lt;br /&gt;
Return values:&lt;br /&gt;
: ''return false''&lt;br /&gt;
:: If size is bigger then 32 bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====abi_CMD_LOAD_STATE====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_CMD_LOAD_STATE()&lt;br /&gt;
Description:&lt;br /&gt;
: Sends a command requesting the platform to load script data. The response from the platform is not instantaneous and takes several milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
1. Load data at the start.&lt;br /&gt;
 // This function is called when a response is received from the platform&lt;br /&gt;
 ON_LOAD_GAME_DATA (const pkt[]) {&lt;br /&gt;
    // Deserialize pkt&lt;br /&gt;
    currentLevelNumber = pkt[1]; // Starting with 1 cause 0 pkt element holding command ID&lt;br /&gt;
    score = pkt[2];&lt;br /&gt;
    moves = pkt[3];&lt;br /&gt;
    ...&lt;br /&gt;
    record = pkt[8];&lt;br /&gt;
 }&lt;br /&gt;
 ON_INIT () {&lt;br /&gt;
    abi_CMD_LOAD_STATE ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
2. Save the data after the end of the level.&lt;br /&gt;
 SaveGameState () {&lt;br /&gt;
    new saveData [GAME_SAVE_SIZE];&lt;br /&gt;
    // Assign all necessary data&lt;br /&gt;
    saveData[0] = currentLevelNumber;&lt;br /&gt;
    saveData[1] = score;&lt;br /&gt;
    saveData[2] = moves;&lt;br /&gt;
    ...&lt;br /&gt;
    saveData[7] = record;&lt;br /&gt;
    &lt;br /&gt;
    abi_CMD_SAVE_STATE (saveData);&lt;br /&gt;
 }&lt;br /&gt;
 ON_CHECK_ROTATE () {&lt;br /&gt;
    if (isLevelFinished) {&lt;br /&gt;
        SaveGameState();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Time functions===&lt;br /&gt;
====abi_GetTime====&lt;br /&gt;
Syntax:&lt;br /&gt;
  abi_GetTime()&lt;br /&gt;
Description:&lt;br /&gt;
: Get current time in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
 new previousTime = 0;&lt;br /&gt;
 new currentTime = 0;&lt;br /&gt;
 new deltaTime = 0;&lt;br /&gt;
 ON_INIT() {&lt;br /&gt;
    previousTime = abi_GetTime();&lt;br /&gt;
 }&lt;br /&gt;
 ONTICK() {&lt;br /&gt;
     currentTime = abi_GetTime();&lt;br /&gt;
     deltaTime = currentTime - previousTime;&lt;br /&gt;
     previousTime = currentTime;&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Raccoon pirate</name></author>
		
	</entry>
</feed>