How do i make a mouse drag? (Rectangle Box Drag)

Get help using Construct 2

Post » Fri Nov 09, 2012 10:02 pm

Hi i have wonered how i could make a rectangle box that has the same size at the point id clicked left click to that point i do have my mouse clicked in, like it making a rectangle!          Like this:

Please Reply! I am making an rts game!   ;)

           HPA972012-11-09 22:03:03
B
9
S
2
Posts: 41
Reputation: 1,756

Post » Fri Nov 09, 2012 10:07 pm

I made this example for someone a while back:

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

Post » Fri Nov 09, 2012 10:20 pm

Thank you soo much man! ;)
B
9
S
2
Posts: 41
Reputation: 1,756

Post » Sat Nov 10, 2012 2:11 am

Nice. Perfect for RTS games.
B
22
S
9
G
3
Posts: 202
Reputation: 3,645

Post » Sat Nov 10, 2012 3:27 am

@HPA97, @droptank21:

When I look at it now, I realize it can be done with even fewer events, much simpler as well. Have a look if you're interested:

SelectionBox2.capx (r109)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Nov 10, 2012 1:16 pm

I can't get it to work properly, please help!

http://www.mediafire.com/?lrsof26ypg30ttc
B
9
S
2
Posts: 41
Reputation: 1,756

Post » Sat Nov 10, 2012 2:54 pm

So the problem is it doesn't show up? You're creating the box on layer 0 which is probably covered up by some background image or something. Create the box object on a different layer like layer 4, and the box should show up. Not sure if that was all the help you needed.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Nov 10, 2012 3:02 pm

Ahhh! lol! I forgot that! Thanks! :)
B
9
S
2
Posts: 41
Reputation: 1,756

Post » Sat Nov 10, 2012 3:34 pm

And do you think you can help me with this problem? I try to make it so i can click on a buidling so it would change to selected, as well as when i try dragging a box above it, but it seems like it don't wanna work here!

http://www.mediafire.com/?9275m4z5o4jyeas
B
9
S
2
Posts: 41
Reputation: 1,756

Post » Sat Nov 10, 2012 3:50 pm

Here's an example I made before: multipleSelection.capx
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Next

Return to How do I....?

Who is online

Users browsing this forum: Axiomaltd, jeffige and 27 guests