Sign in to follow this  
tdnshah

Phaser PopUp Using Modal.js

Recommended Posts

I want to add popup to the game i am developing using Phaser.js. After searching a bit for the same i could found modal.js for this.

I am trying to integrate modal.js but am unable to get through. And I am getting an error "Uncaught TypeError: Cannot set property 'modal1' of undefined"  below is the part of my code which i am using to add the modals to my game. If any one can help me with this error please will be a great help.

Here is my code 

var reg={};

createModals: function(){
    reg.modal.createModal({
        type: "modal1",
        includeBackground: true,
        modalCloseOnInput: true,
        itemsArr: [{
            type: "graphics",
            graphicColor: "0xffffff",
            graphicWidth: 300,
            graphicHeight: 300,
            graphicRadius: 40
        }, {
            type: "text",
            content: "The white behind me\nis a [Phaser.Graphic]",
            fontFamily: "Luckiest Guy",
            fontSize: 22,
            color: "0x1e1e1e",
            offsetY: -50
        }, ]
    });
        
    },
    
    showModal1: function(){
    reg.modal.showModal("modal1");
    }

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.