ID:1345554
 
(See the best response by Stephen001.)
Code:
atom
MouseEntered(location)
var/player/p = usr

if(p.is_dm() && p.class:create_data.currently_building)

var/obj/castle/current = p.class:create_data.currently_building
del p.class:create_data.currently_building_image

var rgbMod = rgb((!is_valid_for_building(current) ? 200 : 0), 0, 0, 150)

var/icon/fixed_icon = icon(current.icon+rgbMod, current.icon_state)

p.class:create_data.currently_building_image = image(fixed_icon, src)
p << p.class:create_data.currently_building_image


Problem description:
This image is what I'm currently working with. The code above shows how I make the image shown on MouseEntered. The only problem is, when I'm moving the mouse internally on the image, MouseEntered does not fire. I've tried making atoms have a mouse_opacity of 2 to take precedence, too, no dice.

How can I get it to fire even while moving the mouse around on the image? Something like setting mouse_opacity to 0 on the image is what I'm going for. I was hoping for a general MouseMove function, but it doesn't seem like there's one of those built in.
MouseEntered() only runs when the mouse enters whatever object it's for. Until MouseExited() runs, MouseEntered() wont run again, normally.

Why would you want to run a proc every time the mouse moves, though? That's pretty CPU intensive compared to other mouse procs, so you should be careful trying to do that.
Every time the mouse moves seems to be the only way to capture an accurate location for the mouses x/y coordinates on the map. Since I can't accurately track it with MouseEntered, I'd have to track it with a more generic MouseMove (which I'm going to look at HiroTDKs library for that later).
Best response
http://www.byond.com/developer/HirotheDragonKing/ HDKMouseAndKeys

This is probably your best bet, that should be able to report mouse updates in general. To reduce the amount of stuff back, you may want to include some kind of javascript object filter, to check some basics (like you've crossed and x/y boundary, if the library doesn't already do so) before reporting the event to the server.