[Suggestion]add action for mouse plugin

Discussion and feedback on Construct 2

Post » Sat Nov 29, 2014 2:14 pm

Can I ask for the action for mouse plugin as "set cursor position" "set cursor position to another object" ? :)
B
36
S
11
G
1
Posts: 80
Reputation: 3,300

Post » Sat Nov 29, 2014 2:22 pm

+1 This would be good for restricting mouse to move to another monitor on fullscreen when using multiple monitor setup. Also I think people using something like Q3D plugin would like this if it doesn't have it's own function.
B
34
S
9
G
3
Posts: 517
Reputation: 5,206

Post » Sat Nov 29, 2014 10:19 pm

This is something that bother me also. When a Sprite's movement is based upon the mouse position, when the layout begins the Sprite begins to move without the user doing anything, just because the default mouse position is where ever the mouse is on the desktop at the time of the game's initialization.

Ideally, the mouse object should be inert until the user does something or the game tells it to do something, and the initial position should be fixed (if so desired).

Check the attached capx to see what I mean. Is there a workaround that?
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649

Post » Sat Nov 29, 2014 10:44 pm

Setting the mouses position is prohibited in js.
http://stackoverflow.com/questions/4752 ... c-position

Otherwise the only other solution is mouse lock but that only works in Chrome or Firefox.
plugin-mouse-lock-v0-3-updated_t102112?&hilit=mouse+lock

@eli0s
The issue is the mouse position is 0,0 at the start and with javascript you can only get the position once the mouse moves. It would be solved if the mouse position could be retrieved without moving the mouse but that doesn't seem to be the case.
http://stackoverflow.com/questions/2601 ... -the-mouse

One solution for your example is to only move the box if mouse.x is nonzero.
B
91
S
31
G
103
Posts: 5,238
Reputation: 67,762

Post » Sun Nov 30, 2014 9:01 pm

Dear @R0J0hound, thank you for your input. It's unfortunate that this is inherently to Js.

I'll try to work something around your suggestion!
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649


Return to Construct 2 General

Who is online

Users browsing this forum: vegapomme27 and 1 guest