Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <footer><div id=phaser-example></div></footer>


                html, body {
  height: 100%;

body {
  margin: 0;
  padding: 0;
  background: #222;
  color: #eee;
  font: caption;


                const COLOR_PRIMARY = 0x4e342e;
const COLOR_LIGHT = 0x7b5e57;
const COLOR_DARK = 0x260e04;

class Demo extends Phaser.Scene {
    constructor() {
            key: 'examples'

    preload() { 
            key: 'rexuiplugin',
            url: '',
            sceneKey: 'rexUI'

    create() {
        var content = 'Phaser is a fast, free, and fun open source HTML5 game framework that offers WebGL and Canvas rendering across desktop and mobile web browsers. Games can be compiled to iOS, Android and native apps by using 3rd party tools. You can use JavaScript or TypeScript for development.'

            x: 400, y: 300,
            width: 400, height: 40,
            orientation: 'y',
                this.rexUI.add.roundRectangle(0, 0, 1, 1, 0, COLOR_PRIMARY)
            .add(this.add.text(0, 0, 'Header'))
            .add(CreateDOM(this, content))
            .add(this.add.text(0, 0, 'Footer'))

    update() { }

var CreateDOM = function (scene, content) {
    var dom = scene.add.dom().createFromHTML(content); = '400px';
    return dom;

var config = {
    type: Phaser.AUTO,
    parent: 'phaser-example',
    width: 800,
    height: 600,
    scale: {
        mode: Phaser.Scale.FIT,
        autoCenter: Phaser.Scale.CENTER_BOTH,
    dom: {
        createContainer: true
    scene: Demo

var game = new Phaser.Game(config);