wondering how to tell if the mouse is over an entity like an enemy or a door or any other model so that I can change the mouse icon (kinda like when you move your mouse over a hyperlink in IE)
Posted By: Anonymous
Re: Mouse Gestures - 02/09/09 18:19
You can use
mouse_ent to get the entity touched by the mouse pointer.
If you typify all your entites (e.g. set skill1 to a typedefined id) you can change the
mouse_map when touching an entity.
function auto_mousecursor(){
while(1){
if(mouse_ent){
switch(mouse_ent.skill1){
case gc_typid_enemy: mouse_map=bmp_sword; break;
case gc_typid_gold: mouse_map=bmp_hand; break;
case gc_typid_food: mouse_map=bmp_bag; break;
case gc_typid_citizen: mouse_map=bmp_talk; break;
deafult: mouse_map=bmp_cursor; break;
}
}else{
mouse_map=bmp_cursor;
}
}
}
got it?
Posted By: Darkyyes
Re: Mouse Gestures - 03/03/09 05:29
I need to ask for help in this function, how exactly to make my "enemies" recognizable with this function?
Posted By: Anonymous
Re: Mouse Gestures - 03/03/09 06:35
You have to use EVENTS.
The event to enable an entity touched by the mouse pointer is ENABLE_TOUCH (release: ENABLE_RELEASE).
Read the manual about events for this.
Watch the mouse_range to be shure you "reach" the entites.