From: random AT visi DOT net (Michael Bosley) Newsgroups: comp.os.msdos.djgpp Subject: Re: Rubber band code in C & Allegro Date: Fri, 01 May 1998 21:49:22 GMT Organization: @Home Network Lines: 36 Message-ID: <354a4123.345420875@news> References: <35464871 DOT AFF16286 AT wpol DOT com> NNTP-Posting-Host: cx582964-a.nwptn1.va.home.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Tue, 28 Apr 1998 06:11:29 GMT, John Kissell wrote: >Has any one run across C code to generate a rubber band effect used to >"rope in" and select a number of objects using the mouse? I don't have it, although I will need it to, but it should be something like... on MouseButtonDown check to see if there is an object under the mouse pointer if there is and MouseButtonUp, select the object else save x1 coord save y1 coord on MouseMove draw line from saved y1 to (saved y1 + current y) draw line from saved x1 to (saved x1 + current x) draw line from (saved y1 + current y) to current x draw line from (saved x1 + current x) to current y on MouseButtonUp save x2 coord save y2 coord find all mass selectable objects within square of (x1, y1), (x2, y2) Somebody please look this ps.code over cause I might have made a mistake here... Also, I haven't used allegro so I don't know the syntax to use to do the above thx all! Michael Bosley !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Do Not Send Me Unsolicited Email! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!