Custom color cursor

Shari gypsyware at earthlink.net
Thu Mar 27 14:47:00 EST 2003


I'm trying to use a custom color cursor that will work on Mac and Windows.

To do this, I've created a btn "curse", and set the icon of the btn 
to whatever .gif image I wish the cursor to be.

This sets the loc of the fake cursor btn to the mouseLoc.
The cursor is actually still visible, but for this stack, that is okay.
I simply need a visual indicator of what "tool" is chosen.
This is easy to do when you will only be clicking once with the tool, 
but for many clicks, a problem arises...
###

on mouseMove x,y
   if the visible of cd btn "curse" is true then
     set the loc of cd btn "curse" of cd "Mapmaker" of stack "Mapmaker" to x,y
   end if
end mouseMove

###
so far, so good...
Trouble arises when i try to use the tool, there are 946 possible 
targets, and i need the short name of the target for the tool to work.
The following works, but repeating 946 times slows it down when it 
gets to the higher numbers.
###

on mouseUp
   global gMap
   repeat with x = 1 to 946
     if intersect(cd btn "curse",image ("Map" && x) of grp "Map") then
       put x into gMap
       exit repeat
     end if
   end repeat
   editPict
end mouseUp

###  Things I've Tried  ###
I've tried putting a mouseEnter and mouseWithin handler in the 946 objects.
This would allow me to delete the repeat in mouseUp, and go straight 
to editPict.
This fails, because the mouse is actually within cd btn "curse", so 
the mouseEnter handler never executes.
I tried putting a "hole" in the icon for cd btn "curse", hoping to 
trick the pointer into thinking it was not inside cd btn "curse", but 
the pointer was too smart for that.
Any ideas?
###

on mouseEnter
   global gMap
   put word 2 of the short name of me into gMap
end mouseEnter

### Other Things I've Tried ###
I did try doing it with black and white cursors, setting the actual 
cursor to a black/white image, not in the cursor stack.  It sort of 
worked, except it took the image and turned it white.  So basically I 
had a white blob of a shape.  Presumably if you have a white object 
with a black outline, it inverses the colors.  But a black object 
just gets turned white, as far as I can tell, and the white parts 
become transparent.  If it would show the black outline as it does 
with the Chooser tool, this would be acceptable.  I may try this 
again, though I would much prefer the color option, as this issue 
will arise again with another stack, where the cursor MUST be color.

I tried actually cloning the cursor stack, and embedding it into my 
stack, and editing the images.  Total program flake out.  Not worth 
the hassle.
###
-- 
--Shareware Games for the Mac--
http://www.gypsyware.com



More information about the metacard mailing list