Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Stasko on Mon 18/06/2007 16:34:39

Title: Hide mouse cursor,,, Question
Post by: Stasko on Mon 18/06/2007 16:34:39
I have searched everywere on the forums and looked in the manual, ALso i wanna say the manual and these forums are realy great! thhey are very very helpfull for help! But enough about that :P

I am making an intro for my game, i am learning every day more and every day this program is more fun too use!
But how can i let the mouse cursor hide for several scenes of my intro?

I tried in the room script "hidemousecursor'' but it gave an error,, hopefully someone can give me a little explaination about hiding the mouse cursor
:)
Title: Re: Hide mouse cursor,,, Question
Post by: Gilbert on Mon 18/06/2007 16:44:23
It's HideMouseCursor(), the function names are case sensitive, also since it's functipon call you can't leave out the parathesis ().

However, as of V2.7, it's not recommended to use the old style function HideMouseCursor() anymore, better use:
mouse.Visible = false;
Title: Re: Hide mouse cursor,,, Question
Post by: Stasko on Mon 18/06/2007 18:07:53
OK great!

I wil try it out! but i have too use the code for each room again i suppose?
But doesnt mather, i wil see it within a minute thanks.
Title: Re: Hide mouse cursor,,, Question
Post by: Stasko on Mon 18/06/2007 18:35:21
He is giving an error when i write this down.

// room script file
mouse.Visible = false;

What am i doing wrong?  :o
Title: Re: Hide mouse cursor,,, Question
Post by: Khris on Mon 18/06/2007 19:01:35
You can't put commands like that directly into the room script, they have to go inside a function.
For what you want to achieve, go to the room's interactions (in the Room -> Settings pane, click the red lowercase "i"), create a new RunScript-action in "player enters screen (before fadein)", click the "Edit script" button and put the command into the window that's gonna open.
Now close the windows.

If you click the {}-button you can see that adding a RunScript-action added a function to the room script; the code you've put in the window actually went inside that function.

This is the procedure for everything you want to happen inside the game; think, when or caused by what you want things to happen, then put the code in the appropriate function.
Title: Re: Hide mouse cursor,,, Question
Post by: Ashen on Mon 18/06/2007 22:05:22
Khris' answer is correct - but in future please say WHAT THE ERROR SAID. Just telling us there was an error really doesn't help with figuring out how to solve it, except in obvious cases like this. (I'd guess it was an 'parse error: unexpected ...' one, as dealt with in the BFAQ (http://americangirlscouts.org/agswiki/Scripting%2C_Code_%26_Interaction#error:_.28line_xyz.29:_Parse_error:_unexpected_.28whatever.29).)