# CrossBrowdy

by Joan Alba Maldonado (joanalbamaldonadoNO_SPAM_PLEASE AT gmail DOT com, without NO_SPAM_PLEASE)

Your cross-browser brodie!

CrossBrowdy is a Multimedia JavaScript framework that can be used to create real cross-platform and hybrid game engines, games, emulators, multimedia libraries and apps.

It is compatible with web browsers, desktop and laptop computers, mobile devices (phones, tablets), desktop and handheld video game consoles, TV sets, smart watches, embedded devices and many others.

It is open source and free.

Main web site: https://crossbrowdy.com/

# About & FAQ

Visit the About & FAQ section to know more about CrossBrowdy.

# Download

To include it in your project and start using it, the most common way to download CrossBrowdy for production is through the Download section from the official web site.

You can also download CrossBrowdy from the GitHub repository directly. Just download the whole content of the dist/ folder.

Alternatively, from the command line (shell), you can also use one of the following commands to download CrossBrowdy while you are in your project folder:

## Using Yarn:

    yarn add crossbrowdy

## Using npm:

    npm i crossbrowdy

## Using pnpm:

    pnpm i crossbrowdy

## Using Bower:

    bower install jalbam/crossbrowdy --save

Note: Yarn, npm, pnpm and Bower will also download the API documentation.

# Hotlinking

Instead of downloading CrossBrowdy, you can hotlink it by directly pointing to a version available online. For instance this way you will be pointing to the last version:

    <script src="https://crossbrowdy.com/CrossBrowdy/CrossBrowdy.js" type="text/javascript" language="javascript"></script><!-- "type" and "language" parameters for legacy clients. -->

You can find a list of some CDN providers in the Download section of the official web site. Thanks to them, you will be able to always use the last up-to-date version or even to point to a specific version you may prefer.

Have in mind that including the CrossBrowdy main file from a CDN provider should never be done for production. This hotlinking method can be useful just for testing purposes. Some features might not work properly using this way and availability cannot be always guaranteed.

# Getting started

Just include the main JavaScript file, which is called CrossBrowdy.js, in your HTML file. The recommended place to include this main JavaScript file is inside the head section (inside the <head> tag) of the document.

## Here you have a simple example:

    <!DOCTYPE html>
    <html>
    	<head>
    		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
    		<title>My first CrossBrowdy project!</title>
    		<script src="CrossBrowdy/CrossBrowdy.js" type="text/javascript" language="javascript"></script><!-- "type" and "language" parameters for legacy clients. -->
    		<script type="text/javascript" language="javascript">
    		<!--
    			CB_init(main); //It will call the "main" function when ready.

    			//This function will be called when CrossBrowdy is ready:
    			function main()
    			{
    				//Now, you can start using CrossBrowdy here...
    				CB_console("CrossBrowdy started!");
    			}
    		// -->
    		</script>
    	</head>
    	<body>
    		<!-- The "CB_console" element will be used automatically in the case that the client does not support console: -->
    		<div id="CB_console" style="display:none; visibility:hidden; overflow:scroll;">
    			<span style="font-weight:bold;">Console:</span><br />
    		</div>
    	</body>
    </html>

Visit the Getting started topic from the Basic tutorial to learn more.

# Usage

Visit the Guides & Tutorials section to get all the information you may need.

# Learn

Check the Basic tutorial to learn how to use it.

# Examples

Check the Examples section to see some live examples and learn through their code.

# API documentation

For more technical documentation, visit the API documentation section.

There is also a structure diagram that can be useful to get an abstract idea about the logic structure used by CrossBrowdy.

# News

Visit the News section to keep up to date.

# Help

Check "I still have a problem, doubt or suggestion. What can I do?".

# Community & Get Involved

Visit the Community & Get Involved section to access the CrossBrowdy community through different ways and also to get involved and contribute with its development.

Please, before contributing, do not forget to read first the code of conduct and contributing documents.

# Credits

CrossBrowdy project was created by Joan Alba Maldonado (aka Juan Alba Maldonado).
It also uses some external libraries and "third-party" code. The name of these libraries and the name of the authors of these libraries and that other code can be found in the source code as well as in the splash screen (if it was no disabled) and in the console when CrossBrowdy is loading. As this information may vary with each version, it is not included here.

# License

The content from the API documentation, the content from the official web site, including tutorials, examples, etc. created by Joan Alba Maldonado (aka Juan Alba Maldonado) is licensed under a Creative Commons Attribution 4.0 International license (SPDX short identifier: "CC BY 4.0").

The code written by Joan Alba Maldonado (aka Juan Alba Maldonado), which genuinely belongs to the CrossBrowdy project, is licensed under the 2-Clause BSD License (aka "Simplified BSD License" or "FreeBSD License", SPDX short identifier: "BSD-2-Clause").

Apart from that, it is important to have into account that CrossBrowdy uses some external libraries and some code which may have their own license each. It is important to respect each license properly as the responsibility will always lie with you.

See more at "What is the CrossBrowdy's copyright and license?".

## CrossBase/CrossBase.js

Main CrossBase module file.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/CrossBase.js, line 1

## CrossBase/audiovisual/audio/CB_AudioDetector.js

Audio formats and audio APIs support detection. Contains the `CB_AudioDetector` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/audio/CB_AudioDetector.js, line 1

## CrossBase/audiovisual/audio/CB_AudioFile.js

Audio files management, including abstraction for different audio APIs. Possible audio APIs are "WAAPI" (HTML5 Web Audio API), "SM2" (SoundManager 2), "ACMP" (Apache Cordova Media Plugin) or "AAPI" (HTML5 Audio API). Contains the `CB_AudioFile` class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/audio/CB_AudioFile.js, line 1

## CrossBase/audiovisual/audio/CB_AudioFileCache.js

Audio files cache management. Contains the `CB_AudioFileCache` class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/audio/CB_AudioFileCache.js, line 1

## CrossBase/audiovisual/audio/CB_AudioFileSprites.js

Audio sprites management. Contains the `CB_AudioFileSprites` class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/audio/CB_AudioFileSprites.js, line 1

## CrossBase/audiovisual/audio/CB_AudioFileSpritesPool.js

Audio sprites pool management. Contains the `CB_AudioFileSpritesPool` class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/audio/CB_AudioFileSpritesPool.js, line 1

## CrossBase/audiovisual/audio/CB_AudioFile_API_AAPI.js

Audio files management using "AAPI" (HTML5 Audio API). Contains the `CB_AudioFile_API.AAPI` class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/audio/CB_AudioFile_API_AAPI.js, line 1

## CrossBase/audiovisual/audio/CB_AudioFile_API_ACMP.js

Audio files management using "ACMP" (Apache Cordova Media Plugin). Contains the `CB_AudioFile_API.ACMP` class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/audio/CB_AudioFile_API_ACMP.js, line 1

## CrossBase/audiovisual/audio/CB_AudioFile_API_SM2.js

Audio files management using "SM2" (SoundManager 2). Contains the `CB_AudioFile_API.SM2` class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/audio/CB_AudioFile_API_SM2.js, line 1

## CrossBase/audiovisual/audio/CB_AudioFile_API_WAAPI.js

Audio files management using "WAAPI" (HTML5 Web Audio API). Contains the `CB_AudioFile_API.WAAPI` class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/audio/CB_AudioFile_API_WAAPI.js, line 1

## CrossBase/audiovisual/audio/CB_Speaker.js

Speakers management. Contains the `CB_Speaker` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/audio/CB_Speaker.js, line 1

## CrossBase/audiovisual/image/CB_GraphicSprites.js

Group of graphic sprites management (2D or 3D). Contains the `CB_GraphicSprites` class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/image/CB_GraphicSprites.js, line 1

## CrossBase/audiovisual/image/CB_GraphicSpritesScene.js

Groups of graphic sprites management (2D or 3D). Internally, it manages `CB_GraphicSprites` objects. Contains the `CB_GraphicSpritesScene` class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/image/CB_GraphicSpritesScene.js, line 1

## CrossBase/audiovisual/image/CB_Screen.js

Screen management. Contains the `CB_Screen` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/image/CB_Screen.js, line 1

## CrossBase/audiovisual/image/canvas/CB_Canvas.js

Canvas management (including emulation fallbacks). Contains the `CB_Canvas` class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/audiovisual/image/canvas/CB_Canvas.js, line 1

## CrossBase/device/CB_Device.js

Device management. Contains the `CB_Device` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/device/CB_Device.js, line 1

## CrossBase/general/CB_Arrays.js

Arrays management. Contains the `CB_Arrays` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/general/CB_Arrays.js, line 1

## CrossBase/general/CB_Client.js

Web client (browser or engine) management. Contains the `CB_Client` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/general/CB_Client.js, line 1

## CrossBase/general/CB_Collisions.js

Collisions management. Contains the `CB_Collisions` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/general/CB_Collisions.js, line 1

## CrossBase/general/CB_Elements.js

DOM elements management. Contains the `CB_Elements` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/general/CB_Elements.js, line 1

## CrossBase/general/CB_Events.js

Events management. Contains the `CB_Events` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/general/CB_Events.js, line 1

## CrossBase/general/CB_data.js

Data and related management.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/general/CB_data.js, line 1
To Do:
  - A function equivalent to htmlentities/htmlspecialchars (as in PHP).

## CrossBase/general/CB_others.js

Miscellaneous code.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/general/CB_others.js, line 1
To Do:
  - Think about a 'CB_symmetricInterval' function, similar to `CB_symmetricCall` but calling the callback function automatically.

## CrossBase/input/CB_Keyboard.js

Keyboard management (and other devices which also fire keyboard events as TV remote controls, game consoles' gamepads, etc.). Contains the `CB_Keyboard` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/input/CB_Keyboard.js, line 1

## CrossBase/input/CB_Mouse.js

Mouse and related management. Contains the `CB_Mouse` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/input/CB_Mouse.js, line 1

## CrossBase/input/CB_Pointer.js

Pointer management. Contains the `CB_Pointer` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/input/CB_Pointer.js, line 1

## CrossBase/input/CB_Touch.js

Touch events management. Contains the `CB_Touch` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/input/CB_Touch.js, line 1

## CrossBase/input/controllers/CB_Controllers.js

Controllers (gamepads, joysticks, remotes, etc.) management. Contains the `CB_Controllers` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/input/controllers/CB_Controllers.js, line 1

## CrossBase/input/controllers/CB_Controllers_Proprietary_WII.js

Nintendo Wii remotes (Wiimotes) management. Contains the `CB_Controllers_Proprietary.WII` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/input/controllers/CB_Controllers_Proprietary_WII.js, line 1

## CrossBase/input/controllers/CB_Controllers_Proprietary_WII_U.js

Nintendo Wii U gamepad and remotes (Wiimotes) management. Contains the `CB_Controllers_Proprietary.WII_U` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/input/controllers/CB_Controllers_Proprietary_WII_U.js, line 1

## CrossBase/net/CB_Net.js

Management for things related with the net. Contains the `CB_Net` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/net/CB_Net.js, line 1

## CrossBase/net/REST/CB_Net_REST.js

REST client, services and related management. Contains the `CB_Net.REST` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/net/REST/CB_Net_REST.js, line 1

## CrossBase/net/XHR/CB_Net_XHR.js

XMLHttpRequest (XHR, AJAX) and related management. Contains the `CB_Net.XHR` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/net/XHR/CB_Net_XHR.js, line 1

## CrossBase/net/fetch/CB_Net_Fetch.js

Fetch API management. Contains the `CB_Net.Fetch` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/net/fetch/CB_Net_Fetch.js, line 1

## CrossBase/net/sockets/CB_Net_Sockets.js

Sockets and related management. Contains the `CB_Net.Sockets` static class.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBase/net/sockets/CB_Net_Sockets.js, line 1

## CrossBrowdy.js

Main CrossBrowdy file.

Author:
  - Joan Alba Maldonado
License:
  - Creative Commons Attribution 4.0 International. See more at https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license.
Source:
  - CrossBrowdy.js, line 3
To Do:
  - Clear all timeouts before creating them (just in case).

#### Search results