How do I close the game from a botton in game?

0 favourites
  • 4 posts
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • I'm doing a small lite widget in construct to be used on a site. After running the small little mini game, I want to have a close button in the game that closes the game. (or the div/iframe where the game is running)

    How do I go about doing that?

    And some follow up questions:

    Should the game be running in an iframe on the same site? or is it possible to run the game in a div, with the canvas object directly?

    Thanks

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use the "Browser" event by adding in the "close" action

  • No that will close the browser window. I just want to close the div/iframe where the game is running.

    To clarify. On the site there is a button to start the game:

    Clicking this button will open a modal/div with an iframe with the game running inside.

    Once you've finished play the game, there is a close button in the game.

    I need to click this ingame button to close the modal/div on the site.

  • Do you mean a button to go back to the main menu or to close a game exported as an .exe?

    If the former, just create a button with an event to save the game and go to the main menu layout.

    If the latter, I believe the browser close event will work for .exe as well.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)