Clicking outside: Losing focus on the game

Discussion and feedback on Construct 2

Post » Sun Mar 03, 2013 3:15 am

So gurrently my game is on newgrounds:
http://www.newgrounds.com/portal/view/612273

Which is nice and all, but there is one little problem.
As soon as I click outside to the canvas area, the game becomes completely unplayable.

I noticed that other html5 games don't have this problem so I guess I missed something. Can someone tell me how to fix this?

Sidenote:
This does not only happen in Newgrounds, but also on the arcade as well:
http://www.scirra.com/arcade/addicting-action-games/3596/clown-on-a-plane

You can try it youself by starting the game, clicking OUTSIDE of the canvas and then tring to bring focus back to that game.
If I for example take My Irrational Fear of Unicorns:
http://www.scirra.com/arcade/addicting-action-games/1694/my-irrational-fear-of-unicorns
this doesn't happen. So I take I really missed something.Suro2013-03-03 11:22:44
B
18
S
5
Posts: 22
Reputation: 2,346

Post » Sun Mar 03, 2013 5:33 am

I can't help with your problem, but that was the damn most entertaining game I've played in a while. I burst out laughing when he made his little "horhoor" noise and started dancing. Awesome game
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Sun Mar 03, 2013 5:52 am

I thought you were about to criticize Newgrounds for losing its focus on gaming.
Hahaha! Misleading title :)

Thanks for using My irrational fear of Unicorns as an example!Rory2013-03-03 05:53:42
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Sun Mar 03, 2013 8:29 am

@Suro

Make an on any click event, use the browser focus action. It fixed my focus problem with Kongregate...probably will fix yours on Newgrounds as well.theubie2013-03-03 08:29:45
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Sun Mar 03, 2013 11:29 am

Thanks guys!

@Rory:
It was one of the last games I played that I remember had no mouse input during gameplay :D
Besides it's fun to play!

@theubie
I didn't even know such a thing existed!
Sadly it didn't work for me (currently the updated version is on the Scirra Arcade).
B
18
S
5
Posts: 22
Reputation: 2,346

Post » Sun Mar 03, 2013 12:05 pm

Hmm. FWIW, here's a screenshot of my fix, which worked on both Kong and here on Scirra's Arcade:



If that doesn't fix it, not sure what else might be causing it. I would be willing to look at a capx if you want.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Sun Mar 03, 2013 12:29 pm

I'd actually appreciate it :)
I'll send you a link!

Edit:
It seems like my game is the only one that has this problem on the arcade :D
I feel special about it, but I also would like to fix it.
So far I think I haven't forgot anything important, rather that I added something which overwrites the focus going back to the game once you click outside of it.Suro2013-03-03 14:31:18
B
18
S
5
Posts: 22
Reputation: 2,346

Post » Mon Mar 11, 2013 10:32 am

So far I haven't been able to fix this.
I'd appreciate anybody who would be willing to help me in this matter.
B
18
S
5
Posts: 22
Reputation: 2,346

Post » Tue Mar 12, 2013 9:19 am

I am also having this problem.

Here's my game: http://www.scirra.com/arcade/shooter/3837/telefrag1

Let me know if you need anymore information. I'll keep searching for a solution.

EDIT: I did try theubie's solution, but no success.garlow2013-03-12 19:35:12
B
4
Posts: 1
Reputation: 417

Post » Tue Mar 12, 2013 5:27 pm

I found using event from theubie works except... i couldn't get certain keys to return control in Chrome browser. Keys like Spacebar and Ctrl would always lose input but letter keys would return.
B
14
S
4
G
3
Posts: 38
Reputation: 3,741

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 17 guests