|
List Info
Thread: mouse hide
|
|
| mouse hide |

|
2007-01-27 01:52:47 |
but this doesnt work!!
_______________________________________________
dirGames-L mailing list - dirGames-L nuttybar.drama.uga.edu
http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames
-l
|
|
| Re: mouse hide |

|
2007-01-27 10:35:25 |
On Jan 27, 2007, at 2:52 AM, sina asmani wrote:
> but this doesnt work!!
If you're saying that:
cursor 200
doesn't work, then maybe you've put it in the wrong place.
The simple
situation for putting it somewhere is to put it in an
exitframe handler:
on exitframe
cursor 200
go the frame
end
For a fancier cursor control, like say you want the cursor
to appear
if the user moves it to the 2D interface options off to the
side of a
3D sprite, you could use a global variable instead, and have
mouseenter handlers to change that variable. Here's a frame
script:
global thecursor
on exitframe
cursor thecursor
go the frame
end
on beginsprite
thecursor = -1
end
and here's the mouseenter and mouseleave for the 3D sprite:
global thecursor
on mouseenter
thecursor = 200
end
on mouseleave
thecursor = -1
end
The way I would work is different to that though, because
its main
problem is that the mouseleave is making the assumption that
the thing
you are now pointing at requires the arrow to be seen, but
sometimes
you're moving from one area that wants an invisible cursor
to another
that wants an invisible cursor. Or it might want a magnifier
or a
hand, and the setting thecursor to -1 would cause the cursor
to flash
via an arrow cursor.
That can be solved by only setting thecursor variable on
mouseenter,
but still you can get situations where the cursor is over
two sprites,
and one sprite moves out of the way, leaving you with the
wrong cursor.
My usual approach is to include a check in the enterframe or
prepareframe script of each sprite. Then the frame script
would read:
global thecursor
on exitframe
cursor thecursor
thecursor = -1
go the frame
end
and the sprite scripts would be something like this:
global thecursor
property s,mycursor
on beginsprite me
s = the spritenum of me
mycursor = 200 -- or 4 or -1 or 280, etc, to represent
the cursor
this sprite needs
end
on enterframe
if rollover(s) then thecursor = mycursor
end
By working this way, the topmost sprite that the cursor is
over will
dictate what cursor is shown by the frame script, and if no
sprite is
pointed out the cursor will default to the arrow. Now, even
this way
of working can be defeated if you're setting the locz of
sprites! But
it goes a long way towards having good cursor control.
Many will argue that setting a global on perhaps several
sprites'
enterframes is bad practice, but it does the job, and the
overhead is
more or less zero.
_______________________________________________
dirGames-L mailing list - dirGames-L nuttybar.drama.uga.edu
http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames
-l
|
|
| Re: mouse hide |

|
2007-01-27 17:14:29 |
I think I saw "cursor 200" no functioning
correctly on a shockwave movie I
ran on the Mac. The cursor behaved quite differently on the
Mac in Safari
than it did on Windows in IE. This was a few years ago. I
can't remember
specifically how the problem manifested itself.
On 1/27/07, Colin Holgate <coiin rcn.com> wrote:
>
>
> On Jan 27, 2007, at 2:52 AM, sina asmani wrote:
>
> > but this doesnt work!!
>
> If you're saying that:
>
> cursor 200
>
> doesn't work, then maybe you've put it in the wrong
place. The simple
> situation for putting it somewhere is to put it in an
exitframe handler:
>
> on exitframe
> cursor 200
> go the frame
> end
>
> For a fancier cursor control, like say you want the
cursor to appear
> if the user moves it to the 2D interface options off to
the side of a
> 3D sprite, you could use a global variable instead, and
have
> mouseenter handlers to change that variable. Here's a
frame script:
>
> global thecursor
>
> on exitframe
> cursor thecursor
> go the frame
> end
> on beginsprite
> thecursor = -1
> end
>
> and here's the mouseenter and mouseleave for the 3D
sprite:
>
> global thecursor
> on mouseenter
> thecursor = 200
> end
> on mouseleave
> thecursor = -1
> end
>
> The way I would work is different to that though,
because its main
> problem is that the mouseleave is making the assumption
that the thing
> you are now pointing at requires the arrow to be seen,
but sometimes
> you're moving from one area that wants an invisible
cursor to another
> that wants an invisible cursor. Or it might want a
magnifier or a
> hand, and the setting thecursor to -1 would cause the
cursor to flash
> via an arrow cursor.
>
> That can be solved by only setting thecursor variable
on mouseenter,
> but still you can get situations where the cursor is
over two sprites,
> and one sprite moves out of the way, leaving you with
the wrong cursor.
>
> My usual approach is to include a check in the
enterframe or
> prepareframe script of each sprite. Then the frame
script would read:
>
> global thecursor
>
> on exitframe
> cursor thecursor
> thecursor = -1
> go the frame
> end
>
> and the sprite scripts would be something like this:
>
> global thecursor
> property s,mycursor
>
> on beginsprite me
> s = the spritenum of me
> mycursor = 200 -- or 4 or -1 or 280, etc, to
represent the cursor
> this sprite needs
> end
> on enterframe
> if rollover(s) then thecursor = mycursor
> end
>
> By working this way, the topmost sprite that the cursor
is over will
> dictate what cursor is shown by the frame script, and
if no sprite is
> pointed out the cursor will default to the arrow. Now,
even this way
> of working can be defeated if you're setting the locz
of sprites! But
> it goes a long way towards having good cursor control.
>
> Many will argue that setting a global on perhaps
several sprites'
> enterframes is bad practice, but it does the job, and
the overhead is
> more or less zero.
>
>
>
> _______________________________________________
> dirGames-L mailing list - dirGames-L nuttybar.drama.uga.edu
> http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames
-l
>
_______________________________________________
dirGames-L mailing list - dirGames-L nuttybar.drama.uga.edu
http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames
-l
|
|
| Re: mouse hide |

|
2007-01-27 22:34:46 |
On Jan 27, 2007, at 6:14 PM, Hanford Lemoore wrote:
> I think I saw "cursor 200" no functioning
correctly on a shockwave
> movie I
> ran on the Mac. The cursor behaved quite differently on
the Mac in
> Safari
> than it did on Windows in IE. This was a few years ago.
I can't
> remember
> specifically how the problem manifested itself.
You're right about that, it is still an existing problem in
Safari.
There are also other problems cases, such as on Windows when
there is
any kind of disk accessing you see the hourglass cursor,
that's one of
the reasons to have to keep setting it. The Safari problem
is
something different, I think at one point I even made my own
custom
blank cursor, but I'm not sure if that solved the problem.
_______________________________________________
dirGames-L mailing list - dirGames-L nuttybar.drama.uga.edu
http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames
-l
|
|
[1-4]
|
|