How do I replicate StarCraft2 drag-camera behavior.

Get help using Construct 2

Post » Mon Aug 17, 2015 2:50 pm

In StarCraft II you can hold the middle mouse button to drag the camera, and you can also choose different drag speeds. Can this camera/mouse behavior be replicated in C2? All i was able to do was this: CAPX, but is nowhere near what I need =/

Thanks in advance =)
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Mon Aug 17, 2015 10:02 pm

We use a modified version of this: https://www.scirra.com/tutorials/415/dr ... -and-touch
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Tue Aug 18, 2015 1:32 am

Thanks, but that's pretty much exactly what I did on my own, I need to do a lot more than that.
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Tue Aug 18, 2015 1:39 am

@Sargas

Well, my answer is still the same as the last time, although this time I made an example rather that just saying "use a camera sprite with Scroll-To behavior and scale the movement the way you want".

http://www.rieperts.com/games/forum/Starcraft_map.capx

I found a bug in C2 (and will file a bug report) - if you press and hold the middle mouse button, but release it out side your game window, C2 still thinks the mouse button is down. (EDIT: it only happens in FireFox, so it is not a C2 bug - it probably is a FireFox bug.)

C2 can not prevent the mouse from leaving the game window (unless you go full screen). So, the drag camera function can not completely duplicate the way Starcraft does it... I remember reading a thread a few months ago about some proposal for future browser/HTML5 updates to allow that functionality but couldn't find it just now...

as a bonus, I included a 9-patch selection box that I did recently to help someone distinguish between clicks and dragging to select units. I also made a clickable mini map, and added zoom on the main map.
B
94
S
33
G
20
Posts: 438
Reputation: 17,615


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest