Mail Archives: djgpp/1998/05/01/19:04:52
On Tue, 28 Apr 1998 06:11:29 GMT, John Kissell <jdk AT wpol DOT com> 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!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- Raw text -