Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

crossbrowdy

jalbam1.1kSEE LICENSE IN README.md0.99.9-6.33.3

A Multimedia JavaScript framework to create real cross-platform and hybrid game engines, games, emulators, multimedia libraries and apps.

multimedia, javascript, framework, engine, library, cross-browser, cross-device, cross-platform, gamedev, game-dev, gamedevelopment, game-development, games, emulators, apps, hybrid, apache-cordova, apachecordova, cordova, easy-to-use, javascript-framework, javascript-api, javascript-library, javascript-engine, multiplatform, vanilla-javascript, open, open-source, opensource, free

readme

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?".

changelog

FlashCanvas

You can view a complete ChangeLog at the project page: http://code.google.com/p/flashcanvas/source/list

FlashCanvas-20131211

(Enhancements)

  • Backported the drawImage() code from FlashCanvas Pro. It is now faster and has less problems.
  • Implemented FlashCanvas-specific loadImage() method for CanvasRenderingContext2D interface.
  • Supported canvas.onload event handler.
  • canvas2png() and saveImage() can now take filename as the second argument.

(Bug fixes)

  • There was a possibility that FlashCanvas did not work well when several Internet Explorer windows existed on the screen.
  • The proxy script was accidentally used even when images were on the same domain as the SWF file, if used with absolute URL.
  • FlashCanvas froze if the fillStyle was set to null.
  • Complicated thick lines were sometimes rendered incorrectly.
  • measureText() threw an exception when the argument was numerical.
  • The proxy script should check that the request comes from the same host.

FlashCanvas-20110201

(Enhancements)

  • Improvements to drawImage() and createPattern().
    • Implement error handling.
    • Accept any object that has a src property.
  • Supported asynchronous loading of flashcanvas.js.
  • Throw an exception if the given arguments are invalid.

(Bug fixes)

  • Backported the arcTo() code from FlashCanvas Pro.
  • restore() didn't restore the clipping region correctly.
  • clearRect() should not clear the pixels outside the clipping region.
  • Special characters in a url need to be escaped when passed to Flash.
  • toDataURL("image/jpeg") must composite the image to a black background.
  • Many minor bug fixes thanks to the canvas test suite developed by Philip Taylor.

FlashCanvas-20101115

(Enhancements)

  • Made it possible to load image files from other domain.
  • Prepared FlashCanvas.saveImage() method.
  • Modified strokeText() to draw an outline of the text.
  • textAlign gets to support the directionality of "rtl".
  • Refactored the handling of resize event.

(Bug fixes)

  • Canvas was rendered incorrectly when printed.
    • Canvas was expanded if the page was in quirks mode.
    • The background was painted gray.
  • Tweaked the color parser to check the input more strictly.

(etc.)

  • Included canvas2png.js script that can be used to save a canvas image.
  • Made the examples compatible with IE9.

FlashCanvas-20100904

(Enhancements)

  • Reimplemented fillText().
    • Supported transformations of text.
    • Supported an alpha value of a color.
    • Supported font size with a unit other than "px".
    • Supported font family that contains white spaces in its name.
    • Supported the textAlign attribute of "start" and "end".
    • Gradients and patterns are not supported yet.
  • Implemented strokeText().
    • At present, strokeText() fills text as fillText() does.
  • Implemented measureText().
  • Made it possible to call initElement() before appendChild().
  • Prepared FlashCanvas.setOptions() method for future use.

(Bug fixes)

  • Line styles were not set when the strokeStyle attribute was a CanvasGradient or CanvasPattern object.
  • Patterns were painted ignoring the globalAlpha attribute.
  • arc() didn't add the end point to the subpath when the central angle was greater than 2 pi.
  • closePath() must do nothing if the context has no subpaths.
  • IE8 didn't preload the swf file when the URL was a relative one.
  • Many minor bug fixes.

FlashCanvas-20100623

  • Added a code which emulates ExplorerCanvas library.
  • Added basic support for fillText() (thanks to code from fxCanvas).
  • Added JPEG support to toDataURL().
  • Supported data URI scheme in drawImage() and createPattern().
  • Implemented "Save Image As..." in the right-click context menu.
  • Implemented event bubbling for click and dblclick events.
  • Made it possible to use FlashCanvas library installed in other domain.
  • Optimized drawImage().
  • Reduced CPU time consumption.
  • Various bug fixes in drawImage().
    • draw-image-flip.html, an example from ExplorerCanvas project, is now rendered correctly.
    • Images are rendered in the right order.
  • Fixed a bug that arc() failed to calculate the central angle in some cases.
  • Fixed a bug that swf.resize() method could be called before ExternalInterface was ready for use.
  • Fixed a bug that resize event canceled createLinearGradient().
  • Switched to using onunload event instead of onbeforeunload event.
  • Included several additional Canvas demos.
  • Some minor optimizations.

FlashCanvas-20100131

  • Implement a delayed execution mechanism so as not to process canvas commands while loading SWF or image files.
  • Implement toDataURL(). Only "image/png" MIME type is supported now.
  • Improve drawImage()
    • globalAlpha attribute is supported
    • Bug fixes regarding the source rectangle
  • Refine the source code
  • Add document files
  • Many small bug fixes

FlashCanvas-20091123

  • Initial release