AGS 2.7 / GetGUIObjectAt as an integer [SOLVED]

Started by , Sat 09/04/2005 00:50:12

Previous topic - Next topic

monkey0506

RE:  My custom scrolling dialog template -- I'm rescripting it in 2.7

Is there a way to get the integer value of the GUI object at a point, i.e., mouse.x, mouse.y?  I have something of a work-around:

Code: ags
short y = 143; /* y-value of GUI */
short my = mouse.y; /* y-value of cursor */
short objHeight = 8; /* height of GUI object */
short objAt = (mouse.y - y) / objHeight; /* object at cursor */


However, this doesn't exactly work the way I need it to now that I've made some changes.  I now have labels behind the seven I use for normal text display, and I shift the labels if the text of a dialog option is too long.  The problem is that this code returns an index of 0 - 6 when really I now need an index of 0 - 13...  I use this to determine which dialog to run when the user chooses an option.  Any help would be greatly appreciated.

strazer

Quote
Is there a way to get the integer value of the GUI object at a point, i.e., mouse.x, mouse.y?

Code: ags

GUIControl *thecontrol = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
if (thecontrol != null) integervalue = thecontrol.ID;

monkey0506


SMF spam blocked by CleanTalk