Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: MrColossal on Wed 12/11/2003 12:10:34

Title: quick suggestions with guis
Post by: MrColossal on Wed 12/11/2003 12:10:34
hey cj quick suggestion

do you think it would be possible:

when i create a gui and set it to unclickable i can't detect if the mouse is over a Gui Object with GetGUIObjectAt(mouse.x,mouse.y);

any way to make that possible?

love,
eric
Title: Re:quick suggestions with guis
Post by: Ben on Wed 12/11/2003 15:02:44
Well, you could do it this way:

if(mouse.x > 40) && if(mouse.x <50) && if(mouse.y > 80) && if(mouse.y <90) {
 //response if mouse is inside these dimensions
}

And just plug in the coordinates for each side of the button..
Title: Re:quick suggestions with guis
Post by: Pumaman on Wed 12/11/2003 20:11:07
The reason for this behaviour is that non-clickable GUIs are assumed to be displaying information only and the user doesn't need to interact with them.

The trouble is, AGS internally uses GetGUIObjectAt to figure out whether the user has clicked on a button and if so run interface_click - so if its behaviour was adjusted, the GUI would effectively become clickable anyway.

Is there a specific reason you need this - perhaps there's another way we can approach it?
Title: Re:quick suggestions with guis
Post by: MrColossal on Wed 12/11/2003 20:48:13
there is a way around it but it's long and script heavy [for ghormak not me]

just a suggestion no worries if it can't be done

eric
Title: Re:quick suggestions with guis
Post by: Pumaman on Wed 12/11/2003 21:54:50
Well, it could be done with an additional command, GetGUIObjectAtEvenIfItsNotClickable or something, so if you need it then I can add it to my list.
Title: Re:quick suggestions with guis
Post by: MrColossal on Wed 12/11/2003 23:26:40
hehehe

no that's ok, the command name isn't long enough and i'd need it for mags anyways so no worries
Title: moRe: quick suggestions with guis
Post by: After on Fri 14/11/2003 06:05:40
1:
Don't impose a (non-zero) margin inside the text region of text window guis. We have borders for that.

For maximum versatility, I suggest,
a) Allow user defined margins including negative values.
b) Centre the text area background horizontally before cropping.
This scheme encompasses a lot of design possibilities.

2:
Non-blocking GUIOn(). I may be able to do it with a normally transparent Persistent GUI, or faking it with overlays and such, but ... yuk.
Title: Re:quick suggestions with guis
Post by: Pumaman on Fri 14/11/2003 09:24:35
QuoteFor maximum versatility, I suggest,
a) Allow user defined margins including negative values.
b) Centre the text area background horizontally before cropping.
This scheme encompasses a lot of design possibilities.

Sounds reasonable to me, I'll add that to my list.

QuoteNon-blocking GUIOn(). I may be able to do it with a normally transparent Persistent GUI, or faking it with overlays and such, but ... yuk.

I'm not sure what you mean here. GUIOn is not blocking, but if the GUI you switch on is set as Popup Modal, then the game will be paused. If you don't want that, then set the GUI as "Normal".
Title: Re:quick suggestions with guis
Post by: After on Sat 15/11/2003 01:42:44
Quote from: Pumaman on Fri 14/11/2003 09:24:35I'm not sure what you mean here. GUIOn is not blocking, but if the GUI you switch on is set as Popup Modal, then the game will be paused. If you don't want that, then set the GUI as "Normal".
Ok, good.
[edit]I thought I'd tried all the modes already, but ... well, somehow I missed it. All working now, thanks.