Mouse.ChangeModeView affects Mouse.UseDefaultGraphic()?

Started by Mr_Threepwood2, Sun 10/06/2007 04:37:57

Previous topic - Next topic

Mr_Threepwood2

OK so here's my situation.

I've set up a Lucas arts style GUI and now I am trying to get the mouse to animate when it goes over hotspots, objects, inv items, etc.  Since I am using mouse mode 8 for most of the game, I knew I'd have to script this in to repeatedly execute.


Here's some of what I have in repeatedly execute
Code: ags

  if (Game.GetLocationName(mouse.x, mouse.y)==""){
		  lblStatus.TextColor=47104;
		  if (mouseAnimating==true){
		    Mouse.UseDefaultGraphic();
		    }
		    
		    
}else{
		  lblStatus.TextColor=63488;
					if (mouseAnimating==false){
					mouse.ChangeModeView(mouse.Mode, mouseViewToUse);
					mouseAnimating=true;
		    }
	}




Now the thing that is the strangest to me is that after I hover over something (it does start to animate at this point) then hover off, it goes to view frame 2 of the view that it was on.  I can't figure out why it isn't going to the one that is set at the default in the editor.


The whole thing with mouse.changeModeView seems odd to me, I was hoping that there was more of a way to control it.  Like if passing -1 to it made it stuck in view frame 1 or something, then I could just keep it always on a view.

So does changeModeView affect the default graphic somehow?  Am I going about this whole business of changing the cursor wrong (considering I will have to use about 8 different views for usermode 8 since it will act as several cursors that all animate over spots)?

Edit:

When I was doing that I was testing around, now I've added this to the first if statement:

Code: ags

		    mouse.ChangeModeView(mouse.Mode, -1);
		    mouseAnimating=false;



and it now goes back to the original graphic.  Is there a better way to control all this business with cursors animating over spots?  So far everything I've done with the cursors has been more or less trial and error.

Akatosh


Mr_Threepwood2

OK I figured it out, had to do a bit of extra stuff to get it to work.


Code: ags

  if (Game.GetLocationName(mouse.x, mouse.y)==""){

		  lblStatus.TextColor=47104;
		  if (mouseAnimating==true){
		    
		    Mouse.ChangeModeGraphic(mouse.Mode, mouseGraphicToUse);
		    mouseAnimating=false;
		    }
		    
		    
}else{
		  lblStatus.TextColor=63488;
					if (mouseAnimating==false){
					mouse.ChangeModeView(mouse.Mode, mouseViewToUse);
					mouseAnimating=true;
		    }
	}



Where mouseGraphicToUse stores the graphic for the current mode, and mouseViewToUse stores the view for the current mouse mode.  I tried to explain my situation about using the easy AGS animation control, here's why I couldn't.

1.  It doesn't animate over inventory icons which I don't like.
2.  I have usermode 8 being 8 effective cursors and each should have different icons, so I can't just switch the views and graphics for it to animate.


What would really be cool in AGS is if all cursors were views no matter what, and just stayed in frame 1 of the view regularly.  I think that would give you better control since then you could do something like mouse.animate, and mouse.goToFrame which would give you more control over it.

SMF spam blocked by CleanTalk