Mouse.SetBounds: At the start of the game?

Started by Joseph, Sat 15/05/2010 19:58:39

Previous topic - Next topic

Joseph

YO long time no C,I'm back. Yay.

I just want to set the boundries of the mouse when the game loads. Where should I place this line?

Code: ags
  mouse.SetBounds(1, 20, 180, 199);


I tried in game_start, doesnt work. Ive search the forums for this without luck aswell. I feel like putting it in rep_exec would be stupid. Im stumped. I know how to make this work in a gui though, but cant get it to load at game start. It also works when I put it in the room's script in room_load, but I dont want to have to add that line in every room's room_load, know what I mean?

Hope its clear :P
Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

Dualnames

That should work.
Code: ags

function on_event(EventType event, int data)  {
if ((event==eEventRoomBeforeFadeIn) && (data!=0)) {
mouse.SetBounds(1, 20, 180, 199);
}
}


data is an integer variable that is for the room the player is about to enter.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Joseph

purrrrrrffffffffect  ;D ;D ;D

Works!!

ps: I like your avatar fish-guy, did you make it?
Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

Dualnames

Quote from: Joseph on Sat 15/05/2010 20:54:55
purrrrrrffffffffect  ;D ;D ;D

Works!!

ps: I like your avatar fish-guy, did you make it?

Glad to be of service.

PS: No, unfortunately I'm not that cool :D.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk