Mouse Panning.

Get help using Construct 2

Post » Thu May 31, 2012 4:08 pm

How to move the layout? In Warcraft 3 was provided .. )
B
5
Posts: 25
Reputation: 425

Post » Thu May 31, 2012 5:23 pm

Compare the mouse position with the current scroll position, then if mouse is outside window, move scroll towards mouse.

Example: ScrollOusideWindow.capx (r92)Nimtrix2012-05-31 17:25:41
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu May 31, 2012 5:26 pm

I'm no expert, but you could start experimenting with a new object whose position would be "Mouse.X, Mouse.Y" at every tick, and then giving that new object the "scroll to" behavior. That way it will always be at the center of the screen, at least... I dunno if you could tweak the speed at which it moves and so on, but maybe is a good starting point. Hope it helps :S
B
43
S
14
G
8
Posts: 47
Reputation: 7,556

Post » Thu May 31, 2012 5:46 pm

@Terrato has the best solution for this. Make the object bound to layout as well
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Thu May 31, 2012 6:24 pm

Thanks.
Nimtrix, worked) but, if i add a player with 'Behavior Scroll To', not work.
How to do that - if the mouse goes off the screen it stops working and switches to ' ScrollOusideWindow.capx', and to go back to 'Behavior Scroll To' should have seen this object.
Sorry for my english.
I would be grateful.
B
5
Posts: 25
Reputation: 425

Post » Thu May 31, 2012 7:33 pm

like that? Panning.capx
Last edited by Yann on Sun Sep 14, 2014 8:25 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu May 31, 2012 7:48 pm

Do you mean something like this?

Scrolling_Updated.capx
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu May 31, 2012 8:42 pm

Yann, thanks, it is also useful.
Exactly, Nimtrix. Thank you very much.
B
5
Posts: 25
Reputation: 425


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests