Mouse does not release

Bugs will be moved here once resolved.

Post » Sun Nov 04, 2012 9:33 pm

Hi Scirra.

I dont know if this is a bug or something else but i dont know where else to get help for my problem.
I already tried the "how do i" section, but no answers there.

The folowing link brings u to my game.
Test

The problem is this:
When the player holds down the mouse button and moves the mouse outside of the iframe and then back in to the game area "stil holding down the mouse button".
Then that mouse button wil be down infinite within the game.
So u can release the mouse button with your finger, but it doesnt release the event in the game.

The Green square sprite is set to move to the mouse X&Y when mouse button is down.
And not to do that when mouse is released.
However, due to this bug the green sprite keeps comming towards the mouse after the player got his mouse button down and outside the iframe.


Here is my CapX

I wonder how to solve this iframe bug, if it has to do with that?
Any help would be great!

Kind Regards.
Savvy001
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Mon Nov 05, 2012 1:50 pm

I cannot reproduce any issue in Chrome if I press the mouse down, move it outside then back in again, then release. It seems to work correctly. The only issue is if you press inside, drag outside, then release. The game doesn't receive the mouse up event, so still thinks the mouse is down. Then you have to click inside the game to get it working again.

I'm not sure what can be done about this - AFAIK the browser just won't send the mouse up event. Perhaps you could try playing with some iframe attributes like seamless or sandbox...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

Post » Mon Nov 05, 2012 2:29 pm

I wil google what seamless or sandbox means and can do for me.
At my own pc i can't get the mouse up to work even after i click inside the game to get it working.
Well, the mouse does release, but the green sprite still keeps moving towards the mouse infinite.
So the green sprite event does not see the mouse releasing.
Only the text that displays mouse down and mouse released functions properly.

Il be looking in to the Tips.
Thanx!
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Mon Nov 05, 2012 3:43 pm

So, it seems to be a physics problem.
The text object does reset after i click the mouse again when in the iframe.
The "apply force to sprite" event on mouse down does not.

I tried the iframe solutions but they did not work for this issue.

I solved it by setting the events to check if the textobject displays "Mouse down".
Because the text object does reset after a click, when the mouse is in the iframe again,

So its solved for now.
But its still a strange iframe/physics object issue

Thanx for the help!

Kind Regards
Savvy001
B
56
S
20
G
13
Posts: 778
Reputation: 13,204


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 5 guests