Custom cursors

Peter Brigham MD pmbrig at gmail.com
Fri Feb 18 17:59:42 EST 2011


On Feb 18, 2011, at 1:46 PM, David C. wrote:

> Hi Richmond,
> How about:
> on mouseEnter
>   set the lockCursor to true
>   set the cursor to 1005 -- your image id
> end mouseEnter
>
> on mouseLeave
>   set the lockCursor to false
>   set the cursor to arrow
> end mouseLeave
>
> Best regards,
> David C.


Best to not lock and unlock the cursor but rather use:
    set the defaultcursor to 1005
on mousemove (occasionally with rapid mouse movement the mousenter  
message doesn't fire off)
and then
    set the defaultcursor to empty
on mouseleave

I used to lock the cursor then unlock it, but then sometimes the  
cursor stays locked and it's very annoying to the user.

Can you use any png for a cursor? or are there constraints? I know  
that if you want transparency you need a png with alpha channel -- a  
jpg will give you an opaque square with your cursor inside it. I seem  
to remember having to do some tricks with the png image before trying  
to use it as a cursor....

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig






More information about the use-livecode mailing list