ID:155588
 
Description:
How would I get an image to follow the mouse using MouseEntered()

I know MouseEntered() and MouseExited() is what I'll be using to do this, but I don't actually know how to put it into code.

Does someone that knows or has already done this have a basic example of this they could share with me?


Thanks.
What exactly are you using it to do? Explain and I MAY have an idea.
In response to Xirre
Pretty much an inventory, that when you hover over the items. A new hud appears with the details and bonus's about the stats. I know how to get that much working except for the whole image following the cursor.

In response to Sean93
Then you'd probably want the MouseOver() proc in the item.

mob/var
BlastLevel=1
BlastDamage=50
BlastDrain=20
BlastDelay=5

turf/Blast
icon='blasts.dmi'
icon_state="blast"
MouseEntered()
usr.BlastEntered()

mob/proc

BlastEntered()
src << "Level:[src.BlastLevel]\nDamage: [src.BlastDamage]\nEnergy Drain: [src.BlastDrain]\nDelay: [src.BlastDelay]"

Just a basic. I used the MouseEntered proc to call upon another proc which will show the user the stats of the blast.

If you want it in a browser like a little box, tell me. I am not 100% experienced, this took me 15minutes to do.. But I can make it so a box appears with they hover over. The only thing is I don't "think" I know how to make the box appear beside the mouse. lol.
In response to Xirre
That's what I'm looking for to be honest, a hover box to appear next to the mouse with recorded stat bonuses or whatever. I can do the stat bonuses, just not the hoverbox at mouse location.
In response to Sean93
Well, let me update that code for you. Though, you can make it appear NEAR the mouse I guess. I will give you new codes. You'll need skins also.. Bleh. How about you just add me on my MSN? [email protected] - I will help you from there to make this quick.
In response to Xirre
Xirre wrote:
Well, let me update that code for you. Though, you can make it appear NEAR the mouse I guess. I will give you new codes. You'll need skins also.. Bleh. How about you just add me on my MSN? [email protected] - I will help you from there to make this quick.

I already added your msn, from following your other posts. It's [email protected]

Just waiting for you to accept, that's all.