pause on unfocus

Get help using Construct 2

Post » Sun Feb 02, 2014 8:50 pm

hi all comunity,
is there a way to not send pause the game when you change the window?
B
11
S
6
G
1
Posts: 53
Reputation: 1,783

Post » Sun Feb 02, 2014 8:59 pm

nope. It's a browser problem and it really sucks. Out of all the problems this problem is a killer for online game s ;|
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Sun Feb 02, 2014 9:00 pm

but my is a multiplayer real time shooter game there's no way for solved this?
B
11
S
6
G
1
Posts: 53
Reputation: 1,783

Post » Sun Feb 02, 2014 10:27 pm

@LimonSpace, the easiest way to pause on unfocus is to click on your project name in the projects bar, then scroll down in the Properties bar until you see the option "Pause on unfocus", then set that to yes. The game would then be paused for that user.

But, since you have a multiplayer game, you may want to pause the game for all players. So, here's the steps to handle that event:
1. Add the Browser plugin to one of your layouts.
2. Create a new event for Browser."On suspended" and Browser."On resumed". These can be found at the bottom in the "Page" section.
3. Add what you want to happen, like a timescale of 0, and sending a message to all other players to also pause.
B
20
S
4
G
1
Posts: 185
Reputation: 2,563

Post » Mon Feb 03, 2014 7:32 am

i don't wanna the pause on my game,this is the problem
i don't wanna the pause on my game,this is the problem.
.09 ms each server sends data to the various players in unfocus and this is right, but the bad thing is that when the player returns to the window, he sees all the movements and things that happened so fast to stabilize and this is horrible , I do not want it. LimonSpace2014-02-03 07:41:35
B
11
S
6
G
1
Posts: 53
Reputation: 1,783

Post » Mon Feb 03, 2014 10:44 am

SOLVED, i create a modal pop-up on start button click and it don't have scroll bar menu bar and is not resizable
B
11
S
6
G
1
Posts: 53
Reputation: 1,783

Post » Mon Feb 03, 2014 1:47 pm

<script type="text/javascript">
function modalWin() {
if (window.showModalDialog) {
window.showModalDialog('contenutoprotetto.php','_blank','dialogWidth:820px;dialogHeight:1150px');
} else {
window.open('contenutoprotetto.php','_blank', 'height=820,width=1150,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes');
}
}
</script>

<button onclick="modalWin()"
style="position:absolute;
     top:80px;
     left: 550px;
     height: 52px;
     width: 156px;
     color: #fff;
     font-weight: bold;
     opacity: 0.7;
     border: 1px solid #999;
     -moz-border-radius: 10px;
     -webkit-border-radius: 10px;
     border-radius: 10px;
     -moz-box-shadow: 0 0 .5em rgba(0, 0, 0, .6);
     -webkit-box-shadow: 0 0 .5em rgba(0, 0, 0, .6);
     box-shadow: 0 0 .5em rgba(0, 0, 0, .6);
     -webkit-appearance: none;
     -moz-transition: opacity .5s;
     -webkit-transition: opacity .5s;
     -o-transition: opacity .5s;
     transition: opacity .5s;
     display: block;
     background-image:url('/css/images/start.jpg');
">
</button>


only work on firefox and IE
B
11
S
6
G
1
Posts: 53
Reputation: 1,783


Return to How do I....?

Who is online

Users browsing this forum: digitalsoapbox, staltux, Yahoo [Bot] and 3 guests