[go: up one dir, main page]

heaps-iframe

Utility for embedding Heaps.io applications in iframes
https://github.com/c-g-dev/heaps-iframe

To install, run:

haxelib install heaps-iframe 1.0.0 

See using Haxelib in Haxelib documentation for more information.

README.md

HeapsIframe

HeapsIframe is a tiny utility for embedding a compiled Heaps.io JavaScript application inside an <iframe>.

Install

haxelib install heaps-iframe

Usage

In a Haxe JS project:

import js.Browser;
import heaps.iframe.HeapsIframe;

class Main {
    static function main() {
        Browser.window. () {
            HeapsIframe.createHeapsIframe({
                // A CSS selector or an Element; defaults to document.body
                container: "#root",
                // Path to your compiled Heaps JS bundle (relative to the page)
                jsUrl: "hello-world.js",
                // Optional sizing and styling
                width: 800,
                height: "600px",
                background: "#000"
            });
        };
    }
}

This will create an <iframe> inside #root (or document.body if no container is given) and load your Heaps app into it with a WebGL canvas filling the frame.

Contributors
cgdev
Version
1.0.0
Published
3 months ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub