I'm trying to make an object that, when selected, creates a floating previewer object wich should stick to the mouse cursor of the player.
First, are there any callbacks to the object, when the item slot in wich the object lies gets selected?
I couldn't find such a thing, so I added an effect that checks via
Secondly, when I have created the previewer, how can I reposition the previewer every frame according to mouse position? I created an effect with "*control*" in it's name:
But how do I get the x and y coordinates of the mouse cursor now?
First, are there any callbacks to the object, when the item slot in wich the object lies gets selected?
I couldn't find such a thing, so I added an effect that checks via
Contained() -> GetHandPos()
. Is there a better way to do it?Secondly, when I have created the previewer, how can I reposition the previewer every frame according to mouse position? I created an effect with "*control*" in it's name:
AddEffect("PreviewControl", this, 100, 1, this);
But how do I get the x and y coordinates of the mouse cursor now?
The best way is obviously to add the callbacks for hand selection and deselection. Remember these should be made last after all updates to prevent null pointers or errors if the callback changes selection or deletes objects.
For the mouse cursor checj the aim control. I think you can activate it and hook in there somehow.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill