0 Favourites

How to create message box in Construct 2?

  • Are there any tutorials to create message box in a game?

  • What do you exactly mean by message box? Like in game text or a pop up window?

  • Yes a game text letting the user know either of High-score or some sort of achievement

  • First of all ... Next time you want to ask something , go to the help section

    Second ... Before you ask something , check the manual ! ... Or ask me :D

    If you want to make multiple acheivements , you will need a lot of variables , but you can use Clay.IO for easy achievements and leaderboards !

  • Ah thanks for that I have read the manual and all that, and I know clay.io, I mean to say something like modal pop-out, let me paste the photo of want i want to achieve


    can we make this as an alert box thing?

  • First of all ... Next time you want to ask something , go to the help section

    Second ... Before you ask something , check the manual ! ... Or ask me :D

    If you want to make multiple acheivements , you will need a lot of variables , but you can use Clay.IO for easy achievements and leaderboards !

    This comment does not address the question and is extremely unhelpful.

    Anyways, to address your question on a message box.

    Credit goes to septeven for writing a dialog box plugin that might do what you are hoping for.


    The comments say there might be some issues with chrome im not sure, check it out and see if it accomplishes what you need.

  • I had the same issue - how to make a modal dialog. You have to do it manually, unfortunately. Below is my experience.

    Note: there is no way to make a sprite disabled, i.e. any sprite, no mater if its invisible, or on an invisible layer, or even under other sprites not get a touch/click event.

    Here are the strategies I tried:

    1) Make a layer above your game layers, and make the layer invisible (There is a check box "Initial visibility" which you can set in the layer settings in the editor, and a check box in the layer panel to make it invisible in the editor when you are done.

    2) Put your game UI input code in one group (or a small number of groups). This group is enabled by default. Put your dialog input events in another group, and make it disabled by default (under group edit in context menu)

    3) When you want to make your modal popup:

    a) disable your game input group (System->General->Set group active).

    b) make your dialog layer visible.

    c) Enable your dialogue UI group.

    4) reverse this when you want to close the group.

    This seems to be the recommended approach, but it didnt work for me as I could not put all my UI code in one group, UI code is spread out in separate event sheets and modularized for maintainability. Also, I have many different modal dialogues, and so I ended up trying to track several groups which turned out to be untenable in a complex project (by brain is too small).

    Instead I took a different approach.

    I leave all UI components active for input (i.e. dont put them in groups). For all my 50+ input events (e.g. "touch->On touch start", "touch->On touched Start" I have a second or third condition which I check the visibility of various layers to deduce which "screen" I am on, i.e. one of several modal dialogues, one of 2 help screens, a settings screen, a game level etc. This was better, but still gave me a headache.

    The current strategy I use is to create modal dialogs within the dotted line of the layout editor, but when the game starts (On layer start), I move the contents of the dialog layers 1024 pixels to the left or right. I then "slide" in the modal screens (such as the settings page) in and out when needed like the swipe on an ipad. This keeps their input out of the way of being pressed. You cant move or animate a layer, unfortunately, so the best way is to put all the sprites in a family, then use "settingsFamily Move 1024 pixels at angle 180". The problem is you cant put text in the family with the sprites for some reason. So then you have two strategies:

    1) pin the text items to one of the sprites.

    2) put the text sprites in their own family, and always move both.

    I started off with 2), but recently Ive do all my dialogs with 1), which turns out to be more maintainable, although it does mean a lot of pin code in your "on start of layout". Its a shame you cant pin one object to another in the editor.

    For the swiping part, there is no tween or animated move to (unless you use one of the many plugins for this), the next best thing is the bullet behavior. However, this wont get the screen exactly to the required destination X, you have to either accept it being approximate, or then manually move it to the exact correct position after. I do a bit of both (if you make the dialog narrow, you can get away with the former).

    I must admit, it's more work than any other system I have developed with in the last 30 years (ok, I;m old - I wrote my first space invaders game when I was 14 on the ZX81 in Z80 assembler).

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Thats was really helpful, the plugin link you provided. It worked <img src="smileys/smiley32.gif" border="0" align="middle" />

  • Thanks Twinsonian    <img src="smileys/smiley32.gif" border="0" align="middle" />

  • to create message box, you can user


    just insert browsert, add action, browser.alert

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic Locked topic
0 Favourites
Construct 3 any news?
889 125,591
uzumiapps's avatar
Unread hot topic
353 32,079
yojona's avatar
Unread hot topic
313 26,485
Juryiel's avatar