The Daily Click ::. Forums ::. Klik Coding Help ::. RTS Drag Box
 

Post Reply  Post Oekaki 
 

Posted By Message

Jack Galilee



Registered
  02/12/2002
Points
  990

VIP Member
20th September, 2003 at 03:19:55 -

ok guys lets cut straight to it ive made myself a dragbox with drawline and active objects and i need some way of selecting all the objects inside the box could u please explain how i would do this with TGF if u cant help me with TGF The explain how to do it in MMF i dont mind ither way... if there is a Drag box extension please tell me were to get it?


 
The only thing better than winning gold in the paralympics is not being retarted

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
20th September, 2003 at 03:57:44 -

It's a lot easier in MMF because you can use an Active System Box that has collision built-in. However, if you're doing it in TGF:

• X position of (Unit) >= X( "Top left of selection box" )
+ X position of (Unit) <= X( "Bottom right of selection box" )
+ Y position of (Unit) >= Y( "Top left of selection box" )
+ Y position of (Unit) <= Y( "Bottom right of selection box" )
(Unit) : Set internal flag 0 on

Here, I'm assuming that to select an object you set their internal flag 0 to ON.

 
n/a

Jimmy Brzezicki



Registered
  16/09/2003
Points
  1057
20th September, 2003 at 10:25:22 -

If you have to ask this question, then no offence but I have to assume you've made a primative drag box (something like a square that just gets bigger or 'shoots' the sides). If this is the case, and you want to make a proper one, you want 8 objets that look like lines, with each direction being twice as long as the previous one. These will form the sides. Then you just have to set two at each corner of the box, one going up and the other horizontal (set them at the corner by setting their X or Y coordinates to the original point or mouse appropriately) and then tell them that every time the distance between the mouse and original click is greater than twice the length of the side (eg Xa-Xb>2, Xa-Xb>4, Xa-Xb>8 etc.) move the direction of animation up one. This way the sides will overlap until the distance apart is too great, then they both get longer and overlap again, forming continuous lines. Sorry if that seems a bit hard to follow but it's hard to explain in full.

 
Why the hell am I on the computer at 1 in the morning? No, don't answer.

Jack Galilee



Registered
  02/12/2002
Points
  990

VIP Member
22nd September, 2003 at 05:00:27 -

I have made a decent drag box thanx Mr Newbie i have a dar line and 4 corners OK! and the all relate to eachother and Chris and his equation WOKRED PERFECTLY

 
The only thing better than winning gold in the paralympics is not being retarted

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
22nd September, 2003 at 15:34:18 -

Although he sounded a little condescending I'm sure it wasn't intentional...

 
n/a

Jimmy Brzezicki



Registered
  16/09/2003
Points
  1057
23rd September, 2003 at 07:37:15 -

It wasn't intentional, and I knew Chris' equation would work. My post didn't answer that question because he already had. It's just that that part seemed a lot easier to me than creating a drag box (something it took me a while to perfect- I just had floating corners and no lines for ages) so I figures I would try and help you out. If you didn't need the help then at least appreciate the amount of time it took me to type it (and by the way, just because I'm new to the site does not mean I am a click newbie).

 
Why the hell am I on the computer at 1 in the morning? No, don't answer.
   

Post Reply



 



Advertisement

Worth A Click