tdnshah Posted March 16, 2017 Report Share Posted March 16, 2017 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"); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.