[hlcoders] drag and drop

2007-09-05 Thread Oliver
--
[ Picked text/plain from multipart/alternative ]
CONTEXT: We'd like to create a drag-and-drop interface for our mod.  When
the user drags off of a panel, the cursor changes and text/image follows the
cursor as the user drags (i.e. user clicks and drags off a panel containing
text "dog"; cursor changes to dog cursor and text "dog" follows cursor
around).

PROBLEM: The cursor change is no problem.  To make the text/image follow the
cursor, we create a transparent panel with a label/image, then set that
panel's position to the mouse position OnTick.  We've tried setting the tick
to occur every .1 sec to every .001 sec but the panel still noticeably lags
behind the cursor.

QUESTION: Is there a way to 'attach' a panel to the mouse position without
lag?
--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] drag and drop

2007-09-29 Thread Daniel Menard
--
[ Picked text/plain from multipart/alternative ]
I would assume this is because the mouse is only updated after your OnTick
code, and there is one frame lag there... I had a similar problem in my mod
because we were setting the position for a panel in the Paint function of
another. The only thing I can think of is to modify the Paint function of
the point, if there is even one, or just let it lag and call it a feature.

On 9/5/07, Oliver <[EMAIL PROTECTED]> wrote:
>
> --
> [ Picked text/plain from multipart/alternative ]
> CONTEXT: We'd like to create a drag-and-drop interface for our mod.  When
> the user drags off of a panel, the cursor changes and text/image follows
> the
> cursor as the user drags (i.e. user clicks and drags off a panel
> containing
> text "dog"; cursor changes to dog cursor and text "dog" follows cursor
> around).
>
> PROBLEM: The cursor change is no problem.  To make the text/image follow
> the
> cursor, we create a transparent panel with a label/image, then set that
> panel's position to the mouse position OnTick.  We've tried setting the
> tick
> to occur every .1 sec to every .001 sec but the panel still noticeably
> lags
> behind the cursor.
>
> QUESTION: Is there a way to 'attach' a panel to the mouse position without
> lag?
> --
>
> ___
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] drag and drop

2007-09-29 Thread Oliver
--
[ Picked text/plain from multipart/alternative ]
SOLUTION: For anyone still interested, the way to fix this is to update the
position in the OnCursorMoved(...) event rather than in OnTick().  That's
what the devs do in the built-in drag & drop code and it works for custom
jobs as well.  Remember to catch the OnCursorMoved event for all panels that
the mouse could pass through while 'dragging'.

If anyone wants more information, let me know.

On 9/29/07, Daniel Menard <[EMAIL PROTECTED]> wrote:
>
> --
> [ Picked text/plain from multipart/alternative ]
> I would assume this is because the mouse is only updated after your OnTick
> code, and there is one frame lag there... I had a similar problem in my
> mod
> because we were setting the position for a panel in the Paint function of
> another. The only thing I can think of is to modify the Paint function of
> the point, if there is even one, or just let it lag and call it a feature.
>
> On 9/5/07, Oliver <[EMAIL PROTECTED]> wrote:
> >
> > --
> > [ Picked text/plain from multipart/alternative ]
> > CONTEXT: We'd like to create a drag-and-drop interface for our
> mod.  When
> > the user drags off of a panel, the cursor changes and text/image follows
> > the
> > cursor as the user drags (i.e. user clicks and drags off a panel
> > containing
> > text "dog"; cursor changes to dog cursor and text "dog" follows cursor
> > around).
> >
> > PROBLEM: The cursor change is no problem.  To make the text/image follow
> > the
> > cursor, we create a transparent panel with a label/image, then set that
> > panel's position to the mouse position OnTick.  We've tried setting the
> > tick
> > to occur every .1 sec to every .001 sec but the panel still noticeably
> > lags
> > behind the cursor.
> >
> > QUESTION: Is there a way to 'attach' a panel to the mouse position
> without
> > lag?
> > --
> >
> > ___
> > To unsubscribe, edit your list preferences, or view the list archives,
> > please visit:
> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >
> >
> --
>
> ___
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders